This file contains 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
### Keybase proof | |
I hereby claim: | |
* I am rich on github. | |
* I am rcavanaugh (https://keybase.io/rcavanaugh) on keybase. | |
* I have a public key ASBYZCCLNR1xxp6FZzqyR55ebTjLRoMPikJSSUPeTZsexQo | |
To claim this, I am signing this object: |
This file contains 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
require 'rubygems' | |
require 'socketIO' | |
client = SocketIO.connect("https://socketio.mtgox.com/mtgox") do | |
before_start do |f| | |
on_disconnect { p "disconnected"} | |
on_connect { emit("connect", nil); p "connected" } | |
on_heartbeat { p "."} | |
on_message { |msg| p msg } | |
on_json_message { |json| p json} |
This file contains 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
#!/bin/sh | |
# | |
# redis - this script starts and stops the redis-server daemon | |
# | |
# chkconfig: - 85 15 | |
# description: Redis is a persistent key-value database | |
# processname: redis-server | |
# config: /etc/redis/redis.conf | |
# config: /etc/sysconfig/redis | |
# pidfile: /var/run/redis.pid |
This file contains 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
rvm 1.9.1@bundlerrvm |
This file contains 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
require 'rubygems' | |
begin | |
gem 'doesntexist' | |
rescue Gem::LoadError | |
end | |
gem 'nokogiri', '~> 1' | |
require 'nokogiri' | |
puts "Memory usage: " + `ps u #{Process.pid}`.split("\n").last.split[5] |
This file contains 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
Hello from a_handler3 | |
The event name is "thing.created" | |
The optional argument from the config/events.php file is "a random string for a_handler3" | |
The argument passed to this handler are as follows: | |
Array ( [one] => 10 [another] => hi there ) | |
Hello from a_handler3 | |
The optional argument from the config/events.php file is "a random string for a_handler2" | |
The argument passed to this handler are as follows: | |
Array ( [one] => 10 [another] => hi there ) |
This file contains 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
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed'); | |
$config['profile.created'] = array( | |
array('library', 'point_events', 'assign_points', 100) | |
); | |
$config['question.deleted'] = array( | |
array('model', 'answers', 'question_deleted') | |
); |
This file contains 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
require 'messiah' | |
Messiah.configure do | |
root File.join(File.dirname(__FILE__), 'fixtures', 'www') | |
command 'php-cgi -d cgi.force_redirect=0' | |
end |
This file contains 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
module BeanstalkPushSupport | |
def push(payload) | |
return super unless from_beanstalk?(payload) | |
payload = parse_payload(payload) | |
commit = commits.new( | |
:identifier => payload['revision'], | |
:author => "#{payload['author_full_name']} <#{payload['author_email']}>", | |
:message => payload['message'], |
This file contains 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
with recursive all_categories as ( | |
select * from categories where parent_id = 3 | |
union all | |
select b.* from all_categories a, categories b where a.id = b.parent_id | |
) select * from all_categories order by parent_id; |
NewerOlder