Skip to content

Instantly share code, notes, and snippets.

View richo's full-sized avatar

richö butts richo

View GitHub Profile
alura % /tmp/thing.pl
text=/tmp
RC=0.
alura %
@richo
richo / varnishtest.rb
Created May 17, 2012 00:18 — forked from lox/varnishtest.rb
Varnish::Test syntax
require 'test/unit'
require 'varnish/test'
require 'threading'
# initializer
#
q_in = Threading::Queue.new
q_out = Threading::Queue.new
thread = Thread.new do |q|
require File.expand_path("../../test_helper", __FILE__)
class HelloWorldTest < Test::Unit::TestCase
def test_it_says_hello_world
expect :get, "/hello", "body goes here", { "X-Someheader" => "value" } do |response|
# Assertions about response go here
assert_equal response.body, "body goes here"
end
end
end
@richo
richo / twat.gemspec
Created May 19, 2012 15:27
vimdiff test
# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
require "twat"
Gem::Specification.new do |s|
s.summary = "Command line tool for tweeting and whatnot"
s.description = s.summary
s.add_dependency "twitter"
s.add_dependency "oauth"
#!/usr/bin/env csi -s
; Shitty irc bot, for the lulz
;
; Chicken internals
(use posix)
; Externals
(use openssl)
; Devious internals
(require "lib/irc_internals")
; Credit http://en.wikipedia.org/wiki/Continuation
;;; A naive queue for thread scheduling.
;;; It holds a list of continuations "waiting to run".
(define *queue* '())
(define (empty-queue?)
(null? *queue*))
(define (enqueue x)
(define (mything arg) ->
if arg
(print "true")
(print "false")
; Compiles to
(define (mything arg)
(if arg
(print "true")
class CachyThing
def intitialize
@_items = {}
end
def method_missing(sym)
# TODO Catch setters
if @_items.include? sym
@_items[sym]
else
class Object; extend Base; include Base; end
[0x8549c60] call_user_func(object[0x85b5970], object[0x2d95218]) /home/ubuntu/contests/lib/ergo/classes/Ergo/Registry.php:31
[0x8549af0] lookup("db", NULL) /home/ubuntu/contests/lib/ergo/classes/Ergo/Application.php:165
[0x7fff615ba480] lookup("db")
[0x8549970] call_user_func_array(array(2)[0x85b6228], array(1)[0x85b6300]) /home/ubuntu/contests/lib/ergo/classes/Ergo.php:86
[0x7fff615ba7a0] __callStatic("lookup", array(1)[0x85b6118])
[0x8549700] lookup("db") /home/ubuntu/contests/tests/helpers/Contests/Testing/LazyDatabaseConnection.php:23
[0x7fff615baba0] createConnection("pheasant://contests:contests@localhost:3306/conteststest_cli4fd7310a186a2?new")
[0x8548d00] call_user_func(array(2)[0x2d9bc30], "pheasant://contests:contests@localhost:3306/conteststest_cli4fd7310a186a2?new") /home/ubuntu/contests/classes/Gazelle/Db/ConnectionPool.php:80
[0x8548b30] getConnection("writer") /home/ubuntu/contests/classes/Gazelle/Db/LoadBalancedDatabase.php:144
[0x8548960] _getConnection("writer") /home/ubuntu/contest