Skip to content

Instantly share code, notes, and snippets.

View rich's full-sized avatar

Rich Cavanaugh rich

  • Datalot, Inc.
  • Port Saint Lucie, FL
View GitHub Profile
### 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:
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}
@rich
rich / redis-server
Last active December 14, 2015 19:29 — forked from tessro/redis-server
#!/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
rvm 1.9.1@bundlerrvm
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]
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 )
<?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')
);
require 'messiah'
Messiah.configure do
root File.join(File.dirname(__FILE__), 'fixtures', 'www')
command 'php-cgi -d cgi.force_redirect=0'
end
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'],
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;