Name Mon Lu

Love jQuery/CSS

Blog about Webdev

Twitter supawaza

RSS Twitter Flickr

What I am up to:


Archive for the ‘Web Dev’ Category

I had the plea­sure to expe­ri­ence that last night… again!  Last time it was a plu­gin…  this time is not.  After doing hours of search­ing… peo­ple said that some files maybe infected or the blog could be hacked. Well… that might not be the case. For mine, I recently did an upgrade to the lat­est ver­sion of wod­press, then come back days later the admin sec­tion is all blank – no mat­ter which url I typed.  Here are the symptoms:

  • The blog’s front-end is still work­ing fine, noth­ing seems out of place or broken
  • I got to the login screen, but as soon as I logged in, it was com­pletely blank
  • I could not access any of page in the admin such as by typ­ing: /wp-admin/plugins.php – all blank
Before going into crazy mode on try­ing to fig­ure out what’s going on with what I went through below… If you have sim­i­lar symp­toms like mine, just go to wor­press, down­load a new copy, down­load the bad /wp-admin/ copy, and upload the entire /wp-admin/.  Fixed it for me instantly.  But if you want to know what I had to went through before fig­ur­ing that easy solution…
Oh and before doing this, like I men­tioned above… instead of keep­ing your admin down and mess­ing with it live, I sug­gest down­load the bad copy of the /wp-admin/ locally, upload the brand new copy down­loaded from word­press and con­tinue the diag­no­sis locally.  If the new upload didn’t fix your word­press admin, then it prob­a­bly isn’t the same prob­lem. The rest of this won’t help you.
  1. I checked blog’s front-end and was still run­ning fine – checked if any page is bro­ken or funky stuff show­ing up on the pages.  A bro­ken plu­gin might have be the cul­prit or you sim­ply got hacked
  2. So far so good, noth­ing seems bro­ken or out of place. Login, page goes blank. I run the plu­gin Login Lock­down, so I FTP in and deleted the folder to see if that’s the cul­prit – nope. Put it back in.
  3. Checked the error log and see what threw error(s) recently – did the same thing above. No go.
  4. Found some peo­ple said that empty returns on functions.php or wp-config.php  in your theme can cause that – make sure no blank space on top or bottom…
  5. Some said check files for weird stuff got append on top of some php files – checked all files inside wp-admin folder – nope
  6. Fast for­ward 3 hours later – finally re-uploaded a new copy of the /wp-admin/ – fixed!  Son of a…
Final note:  if it got fixed, but you should at least try to find out which files and what caused it by going through Step 4 or 5 – you never know, you might have been infected.  I wasn’t, just a bad upgrade.
Hope that helps.

As I spent more time play­ing with VIM, I ran into this very sim­ple issue but took a while to find a solution.

Description

If you want to cus­tomize your VIM a bit more, you just have to cre­ate a .vimrc in the root. Even if you create/edit the .vimrc in VIM, bet­ter than Notepad right? NOT! Appar­ently, by default, VIM doesn’t set the file for­mat for you. So it leaves a “trail­ing ^M” and VIM doesn’t like that…

Symptoms

  • Win­dows: it shows a blank screen and has “Hit enter to type com­mand” or some­thing like that before VIM starts. It doesn’t show any errors.
  • Ubuntu (see screen­shot): it actu­ally dis­plays the fol­low­ing errors: “Invalid argu­ment on^M” OR “Trail­ing char­ac­ters ^M” OR “Not an edi­tor com­mand: ^M”

To fix this, it’s actu­ally pretty easy.

While in VIM and in com­mand mode type:

:set fileformat=unix

Of course the set­ting depends on your sys­tem, if you’re on Mac, set it to fileformat=mac. I set mine to unix because I use Git Bash and set it to use unix style, so if you are on Win­dows and set it to dos com­mands… set it to dos. Now you’re safe to edit .vimrc, when you :wq and vim again, the blank black screen (on Win­dows), and “Invalid edi­tor com­mands” should go away.

Haven’t blogged for a long time, finally some­thing I feel proud of and feel like I’m at least +5 on un-deprived.

If you are in Min­nesota, or prob­a­bly heard about the annual Overnight Web Chal­lenge hosted by a group of  local gen­er­ous web agency: The Nerdery. Which was an event to redesign web­sites for local non-profits. I have to say at first I was very ner­vous about it, but I had a blast and learned a lot of things. So here are the details.

The goal

The goal of the chal­lenge is each team can have up to 10 peo­ple (strangers or friends), and each team will pair up with a non-profit cho­sen by The Nerdery. In 24 hours time we are to redesign and build a new web­site for our des­ig­nated local non-profit client.

Out­come

In my case, my team was Team Ven­ture – we were a mixed of for­mer and cur­rent co-workers. Not every­one knows every­one, but we bonded quickly. Our client was Some­place Safe. Even though we couldn’t fin­ish 100%, so we are still con­tin­u­ously work­ing on it and pro­vide sup­port in the next 6 months.

Before

After

Rules

Any­thing goes… PHP, Word­Press, Ruby, what­ever. We could even pre­pare codes ahead (in which I hope we can pre­pare bet­ter next year).

What we did and lessons learned

We chose Word­Press as our plat­form, the lessons I learned from it were:

  1. Don’t build any­thing from scratch if not nec­es­sary, frame­works, frame­works, and frameworks.
  2. Pre-installed plu­g­ins  – take them out if not needed. It’s eas­ier to remove than add
  3. List of jQuery com­po­nents, snip­pets to gen­er­ate Word­Press page con­tents (side­bars etc…)

I am totally going to do the chal­lenge again next year and because the win­ning team: TST Media pulled off some very amaz­ing stuff in one night, they’ve inspired me to push a lot harder than just using a Word­Press plat­form. So hope­fully I’ll start post­ing more updates on what this “push­ing harder” in the next few months.

Other than that, I encour­age all web nerds in MN to try this chal­lenge at least once. It’s thrilling, learn to work faster, and put our web nerdi­ness skills to use in a very mean­ing­ful way. Besides that, you get to meet maybe a Sen­a­tor such as Al Franken, and the Tronguy. Foods in every 3 hours, mas­sage, Yoga, live action Angry Birds and a whole lot more nerdy fun stuff.

I love Zim­plit‘s sim­ple idea, and rel­a­tively easy to setup (depend­ing on server’s con­fig­u­ra­tions). But of course it comes with a head-scratcher. Here are what I learned:

1. Local­host Time­out Error

As many sane devel­oper would do, you want to test almost every­thing on a Local server if you’re using Xampp Lite. I have been expe­ri­enc­ing time­out error. Maybe it’s due to the fire­wall at work, but I am going to inves­ti­gate more using a full veri­son of the Xampp server

2. “public_html” vs “www” Folders

This may sounds crazy, but I think it might have some­thing to do with the con­fig­u­ra­tions of the server. I tried upload­ing to my own server, every­thing works fine. But I couldn’t get it work­ing on my client’s server, it couldn’t CHMOD prop­erly. Crazy enough, I deleted every­thing and re-uploaded every­thing to the public_html folder, CHMOD the proper files, then it worked… I know both fold­ers are basi­cally the same thing, but why it hap­pened the way it did, CRAZY! I tell you. So I’m going to try to repro­duce this “bug” if it is even a bug or just me…

3. jQuery + zim­plit = Site Explosion!

Unfor­tu­nately, today I found out zim­plit will blow up your some parts of your lay­out if you have some sorts of script­ing going on in the back­ground, such as slideshow, hid­den divs. As soon as you insert an editable area, it auto­mat­i­cally inserts its own div and classes inside ALL OF YOUR DIVs! Drove me insane for over an hour why my sim­ple page stopped work­ing with a sim­ple slideshow. I mean it’s not the end of the world, you just have to rework your CSS to fit it in. But it would be nice IF SOMEONE TOLD ME BEFOREHAND!!

Over­all, zim­plit is still an awe­some idea, but it’s quite intru­sive. It works well if you have a very sim­ple web­site or planned ahead to use it at the begin­ning. If you decide to imple­ment after­ward, it is much more dif­fi­cult because you’ll prob­a­bly have to rework lots of CSS. But I think I will try my hands on it again next time when I build a site from scratch.  Just my 2 cents.

I finally gath­ered my brain­cells and launched my new port­fo­lio: Designloper.com today:

Designloper.com

I was try­ing to “brand” myself in a way, what’s bet­ter than a made-up word that describes per­fectly of what I do, right?  I love the lime green col­ors, but I thought it was get­ting too bor­ing with the light gray and white.

mludesign

So I spiced things up this time with dark brown and hot pink.  I was lov­ing the fun col­ors as I was design­ing, it looked almost “hippy” which fits my per­son­al­i­ties – I never did drugs in my life, but I seem so… (more…)

Ver­sion in this arti­cle: jQuery 1.3.2 / CSV2Table 0.03-b-2.9

Lately I started to like CSV (Com­mon Sep­a­rated Val­ues) more and more com­par­ing to XML.XML is a pain to setup even as enter­ing data, then grab­bing the data requires Einstein’s brain plus 3 sleep­less and hair-pulling days of cod­ing… okay, I maybe exag­ger­ated a bit, but that’s how I feel about XML. My first encounter with CSV was InDe­sign, in there, you can import a bunch of data and gen­er­ates PDF like Word’s Mail Merge fea­ture. Then one day, some­one asked me if I can find a bet­ter and eas­ier way to help the non web peo­ple to main­tain a site. I started out with search terms like “jQuery read text files” or some­thing like that, one of the results returned as using CSV and there is a plu­gin called CSV2Table in the jQuery Plu­g­ins web­site by Toshiro Taka­hashi writ­ten ear­lier this year. Test­ing… (more…)

This is going to be a short post. Magic Tags are very awe­some, but on the Pods CMS doc­u­men­ta­tion failed to men­tion some­thing very sim­ple yet use­ful. Before any­thing, here’s a quick run down of what Magic Tags are…

(more…)