Skip to content

Instantly share code, notes, and snippets.

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
# 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;
@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
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 / 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)
$.getJSON("http://tos-dr.info/services/facebook.json").done(function(data) {
return console.log(JSON.stringify(data));
});
@raucao
raucao / gist:3406890
Created August 20, 2012 19:18 — forked from mislav/gist:3313773
hosting one's own email

I want to get off Gmail for two reasons:

  1. my own *@mislav.net address
  2. to get my email under my own control so I can write scripts to process/analyze it

I've asked on Twitter what software should I use.
Here are the aggregated suggestions.

SMTP

@raucao
raucao / uri.js
Created September 6, 2012 10:14 — forked from jlong/uri.js
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
module MiniTest
class Spec
class << self
alias_method :context, :describe
end
end
end
@raucao
raucao / github-issues.css
Last active December 15, 2015 20:29
User style for GitHub issues
@-moz-document url-prefix('https://github.com/') {
.issues-list .issue-name a {
font-size: 14px !important;
color: #333 !important;
}
.issues-list li.read .issue-name a {
color: #555 !important;
}
.issues-list .type-icon {
display: none !important;