Posts

my hackathon experience last weekend

hackathon-post

Me and Jonathan Chan (@jonishungry) had quite the adventure last weekend. Managing a two hour El ride; being completely lost on the UChicago campus; sleeping in a tiny student government office since the venue wasn’t 24/7 (graciously provided by @hackuc); discovering that Fermi worked in Ryerson Hall (where we hacked), and that Carl Sagan used to go to the observation tower there. Oh, and winning second place (by 1 vote)!

...

Model Checking

I had a scheme, which I still use today when somebody is explaining something that I’m trying to understand: I keep making up examples. For instance, the mathematicians would come in with a terrific theorem, and they’re all excited. As they’re telling me the conditions of the theorem, I construct something which fits all the conditions. You know, you have a set (one ball) - disjoint (two halls). Then the balls turn colors, grow hairs, or whatever, in my head as they put more conditions on. Finally they state the theorem, which is some dumb thing about the ball which isn’t true for my hairy green ball thing, so I say, “False!”

...

Rocketship: A Multi-App Sinatra Template

Introducing Rocketship: a Rack based template that integrates multiple micro-frameworks.

github.com/gnarmis/rocketship

I recently came across some useful Sinatra templates and ended up having to integrate several things together in a service I’m currently working on. So, I extracted the basic stuff out and it’s turned out to be useful for spinning up a quick web service. Best thing is that it doesn’t impose a strict structure and you can follow best-practices of your micro-framework of choice.

...

Webdev with Sinatra: a mini-course

cats-mini-course

Northwestern’s CATS group is an amazing mix of technical and creative talent, and I recently had a great opportunity to help people interested in web development get their feet wet. I decided to choose Sinatra, which I’m actively using at my work and which allows a greatly simplified introduction to real web development.

Here’s a link to the video: http://www.youtube.com/watch?feature=player_embedded&v=oDwZPXfCOYs

Also, here’s a link to the associated Github repo: https://github.com/gnarmis/meerkat

Based on this experience, I’m hoping to teach a few more mini-courses in the coming quarters. Maybe RESTful services? Mobile dev? There’s quite a few useful topics to choose from.

...

Running processes in background and redirecting to file

When developing locally, I find it useful to have the full development server logs available. Luckily, Rails 3.1 does this for you in the file ./log/development.log. However, if you want something similar for other frameworks/commands that run continuously and post any errors, etc, directly to the terminal, something like this is useful:

$ rails s >> console.out 2>&1 &

(Replace rails s with any similar command)

Also, you can easily send signals (like ctrl-c) to background processes with kill.

...

Sass and CoffeeScript - Compile and Watch Files with One Command

Do you use Sass and CoffeeScript? Tired of remembering and typing out the compile and watch commands on both of those command-line utilities? I used to do:

$ compass watch
$ coffee -o scripts/ -cw coffee/

…on all of my projects, in separate tabs on the terminal. There had to be an easier way.

Do them both, with the standard configuration, using the script below.

#!/bin/bash
# run `compass watch` at pwd
# run `coffee -o scripts/ -cw coffee/` at pwd
type -P compass &>/dev/null  || { echo "Compass command not found."; exit 1; }
type -P coffee &>/dev/null  || { echo "Coffee command not found."; exit 1; }

if [ ! -d sass/ ] || [ ! -d scripts/ ]
then
  echo "Project not setup correctly! Put sass files in sass/ and coffee in coffee/"
else
  if [ ! -d stylesheets/ ]
  then
    mkdir stylesheets
  fi
  if [ ! -d scripts/ ]
  then
    mkdir scripts
  fi
  echo "Watching changes in sass/ and coffee/ and compiling to stylesheets/ and scripts/ ..."
  `compass watch --quiet` &
  `coffee -o scripts/ -cw coffee/` &
  wait
fi

Add the script into your project, do

...

Deploying TinyPM on Amazon EC2 with Tomcat

Update: this is hopelessly out of date, so don’t follow this guide!

I had a particularly interesting time trying to install TinyPM, which is a Java-based project management solution. After searching el goog for a bit, I couldn’t find an exact walkthrough or recipe, so I decided to make one here for anyone else who’s looking into doing the same.

First, the platform. I chose Amazon’s Elastic Computing Cloud (EC2), although you could easily opt for Rackspace or one of the many Java hosts (Oxxus seemed compelling too). EC2 has a free usage tier that fit the needs of the project so I decided to go with it.

...

Cozy: a Database-less RESTful Layer

After exploring some static site recipes in my staticRack project, I wanted to explore the world of simple, static Content Management Systems. There is a PHP implementation of that sort of idea in Pulse CMS, and Ruby has something a bit different called Nesta. The latter, in particular, is a great solution if you love managing static sites with a desktop text editor and want a simple way to customize or build completely new designs. I decided to explore a custom CMS based on Sinatra to learn building apps with Rack and Sinatra.

...

staticRack: Template for Deploying Static Sites on Heroku

Have you ever looked for a way to quickly build a live prototype as a static site that nevertheless had some sensible version control and had potential for future extension? Well, I have a template (complete with very minimal HTML5 boilerplate) for you [right here][1]! Read on for details.

After recently experimenting with CoffeeScript (and loving it), I felt the need to stage some code quickly somewhere. I already had my computer setup for deployment to Heroku so that was the obvious choice, and a quick search on the interwebz meant that my static sites could now run on Heroku easily. The upside was that I could add a lot of complexity to such a website down the road with minimal hassle. Basically, in the future I could build on it as a Rack-based app or use one of the many easy Ruby frameworks that are Rack-based (like Sinatra). Also, it would mean that I would use Git from the very start of the process, adding some much needed version control to the early stages of prototypes.

...

Finally Found a Good Notebook App

Windows users have long enjoyed OneNote, a truly great solution that has sensible note-taking and note-management. However, those of us on macs, even after buying Office for Mac, don’t quite have something that really solves that issue. Well, I’ve finally found a solution that more than measures up to the challenge: Circus Ponies’ NoteBook.

NoteBook looks, feels, and performs like you would expect it to - that’s reason enough to use it for me. The past few weeks, I’ve been managing everything I do, to some degree, with this app. And I’ve only just started discovering the rich featureset. From managing a complicated project that involves a lot of research to everyday idea-management, I’ve just naturally been drawn to using NoteBook exclusively.

...