Skip to content

Instantly share code, notes, and snippets.

View dstrelau's full-sized avatar

Dean Strelau dstrelau

View GitHub Profile
# <tech> is roflscale
responses = [
"Have you thought about trying %?"
"The only way to scale is %."
"Why not just use %?"
"What about using %?"
"I heard % can handle that just fine."
]
require 'minitest/spec'
module MiniTest
module Rails
class Spec < MiniTest::Spec
alias :method_name :__name__
alias :pending :skip
class << self
def xit(desc='anonymous')
it(name) { skip 'DISABLED' }
# Kittens!
#
# kitten me - A randomly selected kitten
# kitten bomb me <number> - Many many kittens!
module.exports = (robot) ->
robot.respond /kittens?(?: me)?$/i, (msg) ->
msg.send kittenMe()
@dstrelau
dstrelau / nginx.conf
Created November 10, 2011 22:26
watching unicorns with upstart
# turn off marking upstreams as failed via max_fails and fail_timeout
# if you're only using 1 unicorn, you have to list it twice so nginx tries it again
upstream app {
server 127.0.0.1:8080 max_fails=0 fail_timeout=0;
server 127.0.0.1:8080 max_fails=0 fail_timeout=0;
}
# tells nginx to retry another upstream on failure
proxy_next_upstream error;
proxy_pass http://app;
@dstrelau
dstrelau / lolz.coffee
Created October 26, 2011 20:40
hubot script to insert images from bukk.it
# <anything> lolz <anything> - BRING THE LOLZ
select = require("soupselect").select
htmlparser = require "htmlparser"
util = require 'util'
class LolzFinder
constructor: (msg) ->
@msg = msg
@bukkit = "http://bukk.it"
{
"name": "hosted-hubot",
"version": "0.1.0",
"author": "GitHub Inc.",
"keywords": "github hubot campfire bot",
"description": "A simple helpful Robot for your Company",
"licenses": [{
"type": "MIT",
"url": "http://github.com/github/hubot/raw/master/LICENSE"
}],
provider 'provider.yourcompany.com'
service :memcached do
memory 2.gigabytes
end
service :redis do
memory 4.gigabytes
end
[openssl] ../../../bin/rbx -Xdebug extconf.rb
| Breakpoint: Rubinius::Loader#debugger at kernel/loader.rb:545 (53)
| 545: Rubinius::Debugger.start
debug> b Object#create_makefile:1824
* Unable to find method 'create_makefile' in Object
| Would you like to defer this breakpoint to later? [y/n] y
| Deferred breakpoint created.
debug> c
| Resolved breakpoint for Object#create_makefile
debug> b Object#create_makefile:1822
| Set breakpoint 1: /Users/dstrelau/Code/clones/rubinius/lib/19/mkmf.rb:1822 (+1743)
debug> c
creating Makefile
| Breakpoint: Object#create_makefile(target) at /Users/dstrelau/Code/clones/rubinius/lib/19/mkmf.rb:1822 (1743)
| 1822: mfile.print("pre-install-rb: Makefile\n")
debug> n
| Breakpoint: Object#create_makefile(target) at /Users/dstrelau/Code/clones/rubinius/lib/19/mkmf.rb:1823 (1752)
Rubinius Crash Report #rbxcrashreport
Error: signal SIGSEGV
[[Backtrace]]
0 vm 0x0000000101753a46 _ZN8rubiniusL12segv_handlerEi + 486
1 libsystem_c.dylib 0x00007fff92075cfa _sigtramp + 26
2 ??? 0x000000000000001a 0x0 + 26
3 ??? 0x0000000103b7cec3 0x0 + 4357344963
4 vm 0x000000010175aee6 _ZN8rubinius11InlineCache11empty_cacheEPNS_2VMEPS0_PNS_9CallFrameERNS_9ArgumentsE + 504