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 'celluloid' | |
class Something | |
class RemoteScriptError < RuntimeError; end | |
include Celluloid | |
def ssh_command(*) | |
[false, Struct.new(:stdout, :stderr).new("out", "err")] | |
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
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 |
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 'celluloid' | |
module Celluloid | |
class BlockActor | |
include Celluloid | |
def initialize(args, block) | |
@args = args | |
@block = block | |
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
require 'celluloid' | |
module Celluloid | |
class BlockActor | |
include Celluloid | |
def initialize(args, block) | |
@args = args | |
@block = block | |
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
#!/usr/bin/env bash | |
set -e | |
set -x | |
exec 3<&2 >"/tmp/scriptlogs/$(basename $0).$(date +%s).$$.log" | |
exec 2<&1 | |
date |
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
// 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 + ")()"; | |
}); |
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
#!/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 |
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
# 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" |
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
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 | |
+ |
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
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 = [] |