Karrupa

Mobile & Web Application Development Made Simple

Vi(m) vs. (Emacs)

At the risk of re-firing the never ending war between users of these two text editors, I thought I’d try a bit of an experiment: Learn both!

With the slow code-rot of Textmate happening, I’d decided that it might be time to pick up a new editor, one that’s both actively maintained but also extremely well adapted to programming in languages other than Ruby. I mean, lets face it, Textmate was intended for Ruby development on the Mac and it does that admirably.

Enter the classic open-source text editors!

Cached-commons - Javascript API

You probably already use Google’s AJAX Libraries as a CDN for your JavaScripts. But what do you do when Google is slow to add your favorite JavaScript library? Lance Pollard has created Cached Commons , an API for common Javascripts and stylesheets, cached and optimized on GitHub’s CDN.

Cached Commons lists dozens of scripts under categories like visualization, Ajax, syntax highlighting, HTML5, Flash, and testing, complete with links to project sources, demos, even documenation. Don’t see a script you want? Just fork the project and your script for everyone to share.

It looks like CSS libraries are on the TODO list, just like I had asked of Google in Episode 0.3.2!

[ Source on GitHub ] [ Homepage ]

via thechangelog.com

Definitely a great idea. In this age of widespread CDN use, it makes a great deal of sense to use cached sources for such commonly used things. The Google CDN for jQuery is definitely a planned bare minimum in my world. Looks like this will accent that really nicely.

Death to Design Awards

“Ego is the single greatest obstacle to innovation, collaboration and progress.”

I can’t disagree on involving ‘non-designers’ in the process of design awards. In a world where everyone can be considered a designer, ones that are that as a profession have just as much right to an opinion on good design as anyone else.

Sequel Pro - User Admin

I just realized that you can now manage MySQL users using Sequel Pro. I am unsure how long this feature has been in there, but I just spotted the button now. Now I never have to look at phpmyadmin ever again. Great while it lasted, but can’t stand the interface anymore.

Refinery CMS - Geolocator Plugin

Today I wrote my first Refinery CMS plugin.

It’s available here: refinery-geolocation

A very basic PHP to Ruby on Rails to RefineryCMS plugin based on the Google Maps API example. I’m extremely please with how simple plugin creation is for this CMS system. I find plugins to be a bit daunting, generally, so I’ve steered away from creating my own. Often the case is there’s already a fully functional (and well developed) plugin already in common use.

Refinery is a Ruby on Rails based Content Management System. It’s open-source and quite “young” by web technology standards. However, it’s a lot more flexible and very far from bloated compared to other systems I’ve used in the past. It takes the Rails Way as everything is by convention instead of configuration and any functionality you might want to change you can override, whether it’s via a plugin or otherwise.

Here’s what it basically looks like.

It was an interesting challenge in that I still haven’t figured out a database-agnostic way to query the database so for now we’re stuck with using mySQL to store the geo-points.

I also removed much of the google ajax as I’m far more comfortable with how jQuery handles things.

I am sure there’s room for optimizations and improvements, but so far I’m happy with the results.

Display Current Branch in Your Bash Prompt

So, you’re working on a topic branch of changes, perhaps “dev”. You code, test,commit, code, test, commit, push. Standard stuff. Then you go and do a deploy.

WTF?! my changes aren’t there? What is going on?

Oh, right, “master” gets deployed, not “dev”. You forgot to merge the changes into the master branch. You forgot you weren’t coding in the master branch.

Here’s a quick way to remind yourself where you are, right in your bash prompt.

Add this function to your .bash_profile:

and then just add it to your bash prompt like this (mind the named colors …)

Bash Prompt
1
export PS1="$GREEN\h$BLUE \W $YELLOW\$(parse_git_branch)$WHITE\$ "

Bash Prompt

Have fun!