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 sh | |
# subgit | |
# | |
# A tiny wrapper around git to help you manage | |
# Git sub-projects easily, safely, and simply. | |
# | |
# Created by Rusty Klophaus (@rklophaus) | |
# | |
# See http://rklophaus.com/subgit for usage. |
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
def self.cached_method(meth) | |
eval <<-CODE | |
def #{meth}_with_cache | |
return @#{meth} if @#{meth} | |
result = #{meth}_without_cache | |
@#{meth} ||= result | |
end | |
CODE | |
alias_method_chain meth, :cache | |
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
BEGIN { | |
require 'net/http' | |
Net::HTTP.module_eval do | |
alias_method '__initialize__', 'initialize' | |
def initialize(*args,&block) | |
__initialize__(*args, &block) |
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
# Add this to more_web_steps.rb | |
# Selenium docs: http://code.google.com/p/selenium/wiki/RubyBindings#Javascript_Alert/Confirm today! | |
When /^I (accept|dismiss) the "([^"]*)" alert$/ do |action, text| | |
alert = page.driver.browser.switch_to.alert | |
alert.text.should eq(text) | |
alert.send(action) | |
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 'goliath' | |
require 'http_router' | |
# https://github.com/joshbuddy/http_router | |
HttpRouter::Rack.override_rack_builder! | |
class RackRoutes < Goliath::API | |
map('/get/:id') do |env| | |
[200, {'Content-type' => 'text/plain'}, ["My id is #{env['router.params'][:id]}\n"]] | |
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
class Barrier < EM::Synchrony::Multi | |
attr_accessor :env, :status, :headers, :body | |
def initialize env | |
super() | |
@env = env | |
@acb = env['async.callback'] | |
env['async.callback'] = self | |
callback do |
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 | |
$: << File.join(File.dirname(__FILE__), '../lib') | |
require 'goliath' | |
require 'em-mongo' | |
require 'em-http' | |
require 'em-synchrony/em-http' | |
require 'yajl/json_gem' | |
require 'goliath/synchrony/mongo_receiver' # has the aroundware logic for talking to mongodb | |
require File.join(File.dirname(__FILE__), 'auth_receiver') |
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
// Allows you to specify events on the data tied to the view in the same way | |
// that you can specify dom events: | |
// | |
// dataEvents: { | |
// instanceName: { | |
// 'change:name': 'mothed', | |
// delete: 'otherMethod' | |
// }, ... | |
// } | |
registerDataEvents: function(unbind) { |
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
#!/bin/bash | |
SANDBOX_DIR="cabal-dev" | |
SDIST_DIR="./sdist/" | |
SDIST_SUFFIX=".tar.gz" | |
PACKAGES_CONF_DIR=$SANDBOX_DIR"/packages-"`ghc --numeric-version`".conf/" | |
find $SDIST_DIR -name *$SDIST_SUFFIX -print0 | while read -d $'\0' sdist_path | |
do |
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
{-# LANGUAGE | |
GADTs | |
, KindSignatures | |
, DataKinds | |
, PolyKinds | |
, TypeOperators | |
, TypeFamilies | |
, MultiParamTypeClasses | |
, FlexibleInstances | |
, UndecidableInstances |
OlderNewer