This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var sys = require('sys'); | |
var arguments = process.argv.splice(2)[0]; | |
console.log(sys.inspect(arguments)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Client | |
now.ready = function() { | |
now.changeGroup(window.location.pathname) | |
} | |
// Server | |
var app = express.createServer(); | |
var nowjs = require("now"); | |
var everyone = nowjs.initialize(app); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$:.unshift File.join(File.dirname(__FILE__), *%w[lib]) | |
require 'rubygems' | |
require File.join(File.dirname(File.expand_path(__FILE__)), 'lib/gollum/frontend/app') | |
$path = '/var/gollum/wiki.git' | |
Precious::App.set(:gollum_path, $path) | |
run Precious::App |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
routes | |
map.connect "/images/letterpress/:letterpress.png", :controller => 'pages', :action => 'letterpress' | |
controller | |
def letterpress | |
send_file "tmp/letterpress/#{params[:letterpress]}.png", :disposition => 'inline' | |
end | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script> | |
<script> | |
var geocoder = new google.maps.Geocoder(); | |
function success(position) { | |
var latlng = new google.maps.LatLng(position.coords.latitude, position.coords.longitude); | |
geocoder.geocode({'latLng' : latlng}, function(results, status){ | |
$('#saddr').val(results[0].formatted_address); | |
}); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
jody@jodys-macbook-pro-2 ~/code/benefic (master) $ git pull | |
remote: Counting objects: 11, done. | |
remote: Compressing objects: 100% (6/6), done. | |
remote: Total 6 (delta 5), reused 0 (delta 0) | |
Unpacking objects: 100% (6/6), done. | |
From github.com:domain7/benefic | |
e58ffce..fa0dd49 master -> origin/master | |
Updating e58ffce..fa0dd49 | |
Fast-forward | |
.../_client_organization_contact.html.erb | 10 +++++----- |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MobileProvider < ActiveRecord::Base | |
validates_uniqueness_of :name | |
end | |
class Mobile < ActiveRecord::Base | |
include ActionView::Helpers::NumberHelper | |
belongs_to :user | |
belongs_to :mobile_provider | |
before_validation :strip_non_numeric |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pg_dump -Uuser db | gzip > filename.gz | |
scp host:~/filename.gz . | |
psql -U postgres | |
drop database db;create database db; | |
\quit | |
gunzip filename.gz | |
psql db < filename | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wget http://www.five-ten-sg.com/libpst/packages/libpst-0.6.34.tar.gz | |
cd libpst-0.6.34 | |
./configure | |
make | |
make test | |
make install | |
readpst -o ~/contacts ~/MS.pst | |
Opening PST file and indexes... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# github + launchy = gaunchy | |
# open your current repo (+ path) in your browser | |
# $ gaunchy.rb app/models | |
require 'rubygems' | |
require 'git' | |
require 'launchy' | |
g = Git.open('.') |