Skip to content

Instantly share code, notes, and snippets.

@raucao
raucao / active_model_serializers.rb
Created June 7, 2012 10:18 — forked from benedikt/active_model_serializers.rb
Makes mongoid and active_model_serializers play nicely together
# config/initializers/active_model_serializers.rb
Mongoid::Document.send(:include, ActiveModel::SerializerSupport)
Mongoid::Criteria.delegate(:active_model_serializer, :to => :to_a)
sh -c '
portsnap fetch
portsnap extract
BATCH=yes
export BATCH
echo "RUBY_DEFAULT_VER=1.9" >> /etc/make.conf
pkg_add -r autoconf
cd /usr/ports/converters/ruby-iconv
make install
gem install chef --no-ri --no-rdoc
@raucao
raucao / gist:2701857
Created May 15, 2012 13:39
Ruby symbols vs strings
ruby-1.9.3-preview1 :001 > somesymbol = :hithere
=> :hithere
ruby-1.9.3-preview1 :002 > someothersymbol = :hithere
=> :hithere
ruby-1.9.3-preview1 :003 > somestring = "hithere"
=> "hithere"
ruby-1.9.3-preview1 :004 > someotherstring = "hithere"
=> "hithere"
ruby-1.9.3-preview1 :005 > somesymbol.object_id
=> 459688
# Config for Nginx to act as a front-end for Riak
# The main goal is to proxy all GETs directly to Riak, and disallow anything else (POST, PUT, etc)
# Also, disallow use of the map/reduce query links (i.e. /riak/bucket/key/_,_,_)
# Config is in /etc/nginx/sites-available/default or somewhere like that
# Set up load-balancing to send requests to all nodes in the Riak cluster
# Replace these IPs/ports with the locations of your Riak nodes
upstream riak_hosts {
server 127.0.0.1:8098;
data: 2012-02-22T01:54:35.478Z: TypeError: Cannot read property '0' of null
data: 2012-02-22T01:54:35.478Z: at flushEntity (/root/haibu-orchestra/node_modules/orchestra-instrument/lib/instrument/entity-buffer.js...
data: 2012-02-22T01:54:35.478Z: at /root/haibu-orchestra/node_modules/orchestra-instrument/node_modules/utile/node_modules/async/lib/as...
data: 2012-02-22T01:54:35.478Z: at Object.forEachSeries (/root/haibu-orchestra/node_modules/orchestra-instrument/node_modules/utile/nod...
data: 2012-02-22T01:54:35.478Z: at [object Object].flush (/root/haibu-orchestra/node_modules/orchestra-instrument/lib/instrument/entity...
data: 2012-02-22T01:54:35.478Z: at /root/haibu-orchestra/node_modules/orchestra-instrument/lib/instrument/music/register.js:78:19
data: 2012-02-22T01:54:35.478Z: at Client.<anonymous> (/root/haibu-orchestra/node_modules/orchestra-instrument/lib/instrument/client.js...
data: 2012-02-22T01:54:35.478Z: at [object Object].<anonymous> (/root/haibu-orc
info: Welcome to Nodejitsu
info: It worked if it ends with Nodejitsu ok
info: Executing command deploy
info: Authenticated as 5apps
info: Analyzing your application dependencies in server.js
warn: Creating new snapshot for version 0.1.0-9
info: Done creating snapshot 0.1.0-9
error: Error running command deploy
error: socket hang up
error: Error: socket hang up
@raucao
raucao / oauth.coffee
Created May 23, 2011 08:28 — forked from roidrage/oauth.coffee
Example of using Express and node-oauth to do OAuth with Twitter
express = require "express"
sys = require "sys"
util = require "util"
oauth = require "oauth"
fs = require "fs"
app = module.exports = express.createServer()
app.configure('development', () ->
app.use(express.errorHandler({ dumpExceptions: true, showStack: true }))

Game Engines

Name Latest Release Size (KB) License Type Unit Tests Docs Notes
The Render Engine 1.5.3 MIT Cross-browser; extensive API; open-source. 2
gameQuery 0.5.1 CC BY-SA 2.5 Designed to be used with jQuery
gTile 0.0.1 (2008-07-21) Tile based
Akihabara 1.3 GPL2/MIT Classic Repro Intended for making classic arcade-style games in JS+HTML5 3
The Javascript 2D Game Engine GPL Emphasis on gravity/physics/collision detection; uses HTML5 Canvas and ExplorerCanvas for IE support. Focus on limiting CPU usage. 4
The GMP Javascript Game Engine
@raucao
raucao / readitlater_to_instapaper.rb
Created December 24, 2010 07:51
Copy all unread items from RIL to Instapaper
#!/usr/bin/env ruby
require 'rubygems'
require 'ostruct'
require 'httparty'
STDOUT.sync = true
AppConfig = OpenStruct.new
AppConfig.api_key = "key"
{
"priority":"Normal",
"description":"They are all over the place!",
"status":"new",
"milestone":"Priority Updates",
"summary":"Change all help links to point to tender and the tender KB",
"assignee":"John Smith",
"category":"Documentation",
"id":4,
"reporter":"Adam Cooke"