start new:
tmux
start new with session name:
tmux new -s myname
function city_map() { | |
emit({state:this.state, city:this.city}, {zips:1, pop:this.pop}); | |
} | |
function city_reduce(key, values) { | |
out = {zips:0, pop:0}; | |
values.forEach(function (val) { | |
out.zips += val.zips; | |
out.pop += val.pop; | |
}); |
source 'http://rubygems.org' | |
#gem 'rails', '3.0.0.beta3' | |
# Bundle edge Rails instead: | |
gem 'rails', :git => 'git://github.com/rails/rails.git', :branch => 'master' | |
# Use unicorn as the web server | |
# gem 'unicorn' |
-module(base36). | |
-export([encode/1]). | |
encode(Input)-> | |
encode(Input, ""). | |
encode(Input, Encoded) -> | |
if Input > 36 -> | |
E = lookup(Input rem 36), | |
encode(Input div 36,[E|Encoded]); |
class TwitterFetcher | |
def perform | |
api = IndexTank::Client.new(ENV['INDEXTANK_API_URL'] || index_tank_url) | |
index = api.indexes 'idx' | |
streaming_url = 'http://stream.twitter.com/1/statuses/sample.json' | |
EventMachine.run do | |
http = EventMachine::HttpRequest.new(streaming_url).get :head => { 'Authorization' => [ TWITTER_USERNAME, TWITTER_PASSWORD ] } |
db.tweets.update({}, {'$unset' : {'reply_count' :1}}, false, true) |
class ApplicationController < ActionController::Base | |
rescue_from ActiveRecord::RecordNotFound, :with => :record_not_found | |
private | |
def record_not_found | |
render :text => "404 Not Found", :status => 404 | |
end | |
end |
class TestOne | |
def initialize(logger) | |
@logger = logger | |
end | |
def load_doc | |
begin | |
@logger.debug('Starting Document load') | |
@doc = Document.load('resume.txt') |
require 'rspec' | |
require 'koala' | |
describe "new stuff" do | |
before do | |
@graph = Koala::Facebook::API.new("AAACNTDIeX5MBAEZCdoXPE7nsltT3tVuqiCassXFqRzU2uBb1hTdZBtT3kq2YNcsnJOlsZAqRpmi8wZDZD") | |
end | |
describe "hiding page posts" do |
#first instantiate the graph api with our access token | |
@graph = Koala::Facebook::API.new("ACFTHNIWeX5MBAEZCdoXPE7nsltT3tVuqiVoKCIO0CassXFqRzU2uBb1htT3kq2YNcsnJOlsZAqRpmi8wZDZD") | |
#retrieve a page's milestones | |
milestones = @graph.get_connection("256490626309681", "milestones") |