Skip to content

Instantly share code, notes, and snippets.

info: here is my response
info: {"timeframe":"2011-01-01/2012-01-01","emission":867.7579402033563, ... }
info: undefined
var zombie = require("zombie");
var assert = require("assert");
zombie.visit("http://www.orbitz.com/", function (err, browser, status) {
console.log(browser.window.location.href);
console.log(browser.html());
browser.
clickLink('#flightsTab', function(error, browser) {
browser.
fill("airOrigin", "DTW").
@erithmetic
erithmetic / gist:921779
Created April 15, 2011 14:22
OOP Events
// Here's the code I'm working with now:
Careplane = function() {};
Careplane.prototype.onPageLoad = function(ev) {
if(this.firstRun)
this.firstRun();
this.doc = ev.originalTarget;
this.chooseAndLoadDriver();
};

Ruby Intro

Ruby is a program

It takes ruby code as input and runs it. => Interpreted => No compiling(*)

Other programs

  • irb
<?php
# flickr.php
public function photos() {
return ($this->_photos) ?
$this->_photos :
$this->_photos = $this->flickr()->
groups_pools_getPhotos('1362691@N20', NULL, NULL, NULL, $this->num(), 1);
}
315 rvm gemset create passenger
316 rvm use 1.8.7@passenger
318 gem install rails --no-rdoc --no-ri
319 rake gems:install
...
365 rvm list
366 rvm gemset list
367 rvm 1.8.7@passenger
368 gem install rails --version 2.3.5 --no-rdoc --no-ri
369 rake gems:install
@erithmetic
erithmetic / git-hub-diff
Created February 4, 2010 14:12
git hub-diff - a command line utility for generating diffs on github
#!/usr/bin/env ruby
#
# Usage:
# cd /git/project/directory
# git hub-diff 223d60f5486075e74851075fcfeb366d45c17d8b 13c86f00cbfe820c415b46bfd19268284db2a274
# Future features:
# * generate SHAs from refs
# * launchy support
require 'rubygems'
@erithmetic
erithmetic / cuke
Created February 3, 2010 15:52
cuke - a command line script for running Cucumber features tagged with @dev
#!/bin/sh
cucumber --tags @dev
@erithmetic
erithmetic / autounit
Created January 27, 2010 15:45
autotest for PHPUnit
# Prereqs:
# * Ruby
# * gem install watchr
# Usage:
# copy autounit to php project directory
# run watchr autounit
watch('test/.*Test\.php') do |md|
puts "\e[H\e[2J" #clear console
@erithmetic
erithmetic / sudoh
Created January 12, 2010 03:59
Command to run the last command as a sudo command
#!/bin/bash
#
# Wish you had just run the last command as sudo? sudoh will do it!
#
# INSTALLATION
#
# On Mac OS X, add the following to your ~/.bash_profile:
# shopt -s histappend
# export PROMPT_COMMAND='history -a'
# export HISTIGNORE="sudoh"