Skip to content

Instantly share code, notes, and snippets.

View halorgium's full-sized avatar

Tim Carey-Smith halorgium

View GitHub Profile
@halorgium
halorgium / gist:5131182
Last active December 14, 2015 18:39 — forked from reset/gist:5131168
require 'celluloid'
class Something
class RemoteScriptError < RuntimeError; end
include Celluloid
def ssh_command(*)
[false, Struct.new(:stdout, :stderr).new("out", "err")]
end
@halorgium
halorgium / gist:4262517
Created December 11, 2012 21:48
Archive tweets
env TWITTER_USER=TNG_S8 t timeline -n 200 ${TWITTER_USER} |tee ${TWITTER_USER}.tweets.txt |sed -e "/^ @${TWITTER_USER}\$/d" -e '/^$/d' |wc -l
require 'celluloid'
module Celluloid
class BlockActor
include Celluloid
def initialize(args, block)
@args = args
@block = block
end
require 'celluloid'
module Celluloid
class BlockActor
include Celluloid
def initialize(args, block)
@args = args
@block = block
end
#!/usr/bin/env bash
set -e
set -x
exec 3<&2 >"/tmp/scriptlogs/$(basename $0).$(date +%s).$$.log"
exec 2<&1
date
@halorgium
halorgium / github.com.js
Created November 1, 2011 16:10
Load the ISSUES?.md file content as the default issue body
// A crazy dotjs hack
// https://twitter.com/johnbender/status/131123843812179968
// You need to generate an OAuth token: http://developer.github.com/v3/oauth/#oauth-authorizations-api
var functionToLocation = function (fn) {
$(function () {
var js = fn.toString().replace(/\n/g, " ");
console.log(js);
window.location = "javascript: (" + js + ")()";
});
@halorgium
halorgium / gist:1221268
Created September 16, 2011 05:24 — forked from mkb/gist:1218376
#!/usr/bin/env ruby -wKU
@actions = Hash.new {|h,k| h[k] = []}
def tell_program(name, &block)
@actions['songstart'] << lambda do |*args|
IO.popen("osascript", "w") do |f|
f.puts %Q{
tell application "System Events"
if exists process "#{name}" then
@halorgium
halorgium / app.rb
Created June 2, 2009 03:01 — forked from kematzy/app.rb
# Example of how to use multiple Routes in external files/modules
require 'rubygems'
require 'sinatra/base'
# set the root of the whole app
APP_ROOT = File.dirname(File.expand_path(__FILE__)) unless defined?(APP_ROOT)
require "sinatra-external_routes_example"
diff --git a/merb-core/lib/merb-core/dispatch/dispatcher.rb b/merb-core/lib/merb-core/dispatch/dispatcher.rb
index cbd5cf3..ffe9234 100644
--- a/merb-core/lib/merb-core/dispatch/dispatcher.rb
+++ b/merb-core/lib/merb-core/dispatch/dispatcher.rb
@@ -124,33 +124,26 @@ module Merb
#
# :api: private
def dispatch_exception(exception)
+ exceptions.unshift exception
+
diff --git a/rubygems.rb b/rubygems.rb
index e85d97c..8fa9466 100644
--- a/rubygems.rb
+++ b/rubygems.rb
@@ -102,6 +102,7 @@ module Gem
@configuration = nil
@loaded_specs = {}
+ @loaded_stacks = {}
@platforms = []