Author Archives: mrjones

Fancy Diff

0 minutes, 53 seconds

simplediff
simple diff

Let’s say you’ve edited a long HTML file and want find what’s changed against the original. If you were on the command line, you’d turn to ‘diff’, right? This is all fine and dandy, if not mundane and some what obfuscated as to what has changed.

 
fancydiff
fancy diff

However, if you wanted to view the entire files side by side, have the changes appear in context of the rest of the file and easily see where lines have been removed or add, you would use diff with the flags: ‘-yiEbwB’. Now that is a I can get used to.

 
fancydiff
megawide fancy diff

Now if you had a massive file, say a WSDL (say “wizdull”) file from a certain CRM you use at work and you wanted to compare differences, diff to the rescue again. However because we’re seeing the entire file which is over 450K, the only way to parse through this is via ‘less’. If you couple this with increasing the width to 300 columns, it makes reviewing the changes a breeze. Further, you can search with in the diff by using the search features in less.

diff -yiEbwB --width=300 enterprise.wsdl enterprise2.wsdl |less


Fixed Gear + Slipped Chain = Thankful for Brake

0 minutes, 23 seconds

I know a lot of the fixie purists don’t ride with a front brake and just use their mad skidding skills to slalom their way through traffic and sudden stops. However, the other day I was headed back from a trip up to the Oakland hills, hit a big bump and had my chain come off. Now, arguably, my bad mechanic skills are to blame, or possibly my non-horizontal drop outs I’m running with the eccentric hub, but I was very thankful to have a front brake!

Old, broken USB hub = iPod Charger

0 minutes, 14 seconds

I had a an old, powered mini-usb hub that stopped working with my webcam and USB scanner. I was about to toss it when I pondered if it still would would just send power to what ever was plugged in. Sure enough, I now have a wall wart endowed charger for my first gen iPod Shuffle. Handy!

American Born Chinese

1 minute, 10 seconds

abc_monkeyTime to kick of the “review” and “book” tag of this ol’ blog here. As I just finished the OG Watchmen, I’ll start with another graphic novel I read a while ago. Let me preface this by saying it is not only the best graphic novel I’ve ever read, but is in the top 10, possibly top 5 of the best books I’ve ever read. Yes, that good!

American Born Chinese is the title of this wonderful tale about a young Chinese boy growing up in the U.S. What really ties this book together are the three plots woven into it. The author cleverly works the hormone filled, acceptance seeking trials of a blonds, American teen along with the unique adventures of a newly immigrated Chinese boy oh so wisely offset with action packed, water breathing inception of a kung fu monkey demigod. Yes, one of the three main characters is a power hungry monkey demigod who does not wear his shoes on his ears, but on his feet.

There were some solid themes from the hero’s journey in this novel, akin to The Alchemist, but you know, with more fisticuffs, high school brawls and kids speaking Chinese. I must say, of all the themes in this book, the ancient monkey demigod’s struggle is my favorite. His plight to become the equal of the more powerful and wise god gods is chock full of morals, wisdom and humor that is right up my alley.

This book went on to win many awards. Go pick up a copy at your local, locally owned bookstore and find out why.

WordPress: Rich Man’s Blog, Poor Man’s CMS

1 minute, 19 seconds

samplepreviewI’m a big fan of WordPress. I use it here, at plip, I use it work, and most of my friends use it, leave one. The other day, while commuting over the bay bridge, my co-worker and I were singing the praise of how easy WordPress is to use not only as a blogging platform, but also as a poor mans CMS. I’m very partial to Xaraya as an awesome, full featured, unstoppable CMS. However, what about when you have just 3 or 5 pages on your entire site? You wanna help out grandma/great uncle/distant niece with their new web site, but you want to let them edit at their whim. WordPress it!

To prove that this would be easy, I timed myself to download, configure and create a fully WordPress powered site. I didn’t do a dry run or prep any downloads or .htaccess rules. My MySQL user didn’t exist. From scratch I:

  • Downloaded WordPress
    wget http://wordpress.org/latest.zip
  • Unzipped it
  • Created the directory structure
  • Made an exception in my mod_rewrite so that you could browse a sub-directory. Otherwise I have WordPress on greedy mode:
            RewriteCond %{REQUEST_FILENAME} !(/blog/simple-wp) [NC]
            RewriteRule   ^/blog(.*) /core/blog$1  [PT]
  • Surfed around and found some random theme to use
  • Spent a sec hacking the header, footer, page and sidebar templates to have the right DOM elements
  • Whipped up 3 pages and set one to be the default home page of the site
  • Spot checked the new site in IE, FF3 and Safari

Total time according to Toggl was 40 minutes. 40 minutes to have your own rounded corner, fully dynamic navigation (1 page = top navigation), no blog in site, site. Awesome!

Click the image to see the site created in this post. Also you can download the modified theme to see how implemented it.

Plip is no longer a cobblers child

0 minutes, 44 seconds

I work at a software company and do web development there. We have a more or less traditional set up of a dev site (well, a number of them, they’re virtualized under VM Ware) which can then push it’s code to a staging site and that can finally get pushed to a production site. This means developers can break stuff on their own virtualized instance of the site with out mucking up content editors working on staging. In turn, those editors half finished article won’t be seen by any one on the production site.

Welps, thanks to SVN, plip has a copy of the key pieces (home page, blog and URL shortner) in it’s own SVN repository. This means I can check out a local copy via a windows client and have a full dev/staging instance all in one on my desktop at home. Super handy and I should have done it years ago, but I’m just now not being such a lame cobbler!

New news, old open source

1 minute, 33 seconds

Hi faithful readers! Notice anything different about the news on ol’ plip? No? Probably not because there’s been none since December of aught 4. It’s no surprise no one noticed. However, to fight the stale news, encourage freshness, thus garner a new, rejuvenated mass of readers, old open source solutions have taken hold of news: WordPress on our LAMP stack running on Linux! Ok, the last two are not new, but WordPress is and all our news will live there.

On deck in the news section are geeky, bloggy types news: PHP tips and tricks, adventures and places to see, media consumed and ramblings. I guess the last one is redundant, as they’ll all start to ramble.

To give you a taste, here’s the PHP tip of the week: I used to use Magpie RSS to consume RSS feeds I wanted to re-syndicate on another site. Though it does have some nice features like normalizing different feed formats and using a cache file, it was a but heavy to just suck in some news for my own use. In this case, I wanted self syndicate to plip’s home page. Enter the simplexml_load_string() function! I can grab the latest news at the top of my home page:

//prep loading blog contents
$blogURL = "http://".$_SERVER['HTTP_HOST']."/blog/feed/";
$blogRSSraw = file_get_contents($blogURL);
$blogXML = simplexml_load_string($blogRSSraw);

And then further down, I can loop through all the entries and do a little formatting to output the latest news for y’all. Note that each child item (a blog post in this case) is it’s own SimpleXMLElement object. Further note that each key value pair (eg title, date etc.) has a magic “to string” function (which as my co-worker and I found can do unexpected things if you’re print_r-ing).

foreach ($blogXML->channel->item as $post){
	print "link."">".$post->title."";
	print "".strftime ("%d %b %Y",strtotime($post->pubDate) )."
"; print $post->description."

"; }

This tricks works great if you’re consuming search results from a Google Mini search appliance, which is where I first deployed this technique.

Ping, Traceroute and Quotes

0 minutes, 17 seconds

People! I know that there are few of you, seein as we STILL have a gmail invite to give away, but common?! The simpson’s quote pages haven’t been working for months. Did you tell me? No! (like how i switch the blame there?). For your efforts I thank you with two new wizbang ping and traceroute features on plip.

bart quotes, simpson quotes, ping and traceroute.

Gmail contest

0 minutes, 26 seconds

Here’s the deal: we here at plip central have 3 gmail invitations. You provide us with what you think would be the coolest new feature on plip.com and then we will rate them. The top three ideas will get a free gmail account. The contest starts now and ends in a month at the end of October. Submit your new idea via our contact page. There are two rules: You must send me your email address or i can not send your gmail invite and you must use the contact page submit your idea. Now go go go get ’em!

gmail?