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
source 'http://rubygems.org' | |
gem 'sunzi' | |
gem 'rake' | |
gem 'fog' |
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 base_url | |
@base_url ||= "#{request.env['rack.url_scheme']}://#{request.env['HTTP_HOST']}" | |
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
#!/bin/sh | |
# ANDROID_NOTIFICATION is in the format DEVICE_ID/NOTIFICATION_ID/EVENT_TYPE/EVENT_CONTENTS | |
NOTIFICATION_TYPE="`echo $ANDROID_NOTIFICATION | sed 's/.*\/.*\/\(.*\)\/.*/\1/'`" | |
NOTIFICATION_DATA="`echo $ANDROID_NOTIFICATION | sed 's/.*\///'`" | |
if [ $NOTIFICATION_TYPE == "RING" ]; then | |
TEXT_TO_SAY="Call from" | |
elif [ $NOTIFICATION_TYPE == "SMS" ]; 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
class Unicorn::HttpParser | |
alias old_read read | |
def read(socket) | |
env = old_read(socket) | |
DEFAULTS["rack.logger"].debug env["REQUEST_PATH"] | |
env | |
end | |
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 ActiveSupport::TimeWithZone | |
alias_method :original_xmlschema , :xmlschema | |
def xmlschema(fraction_digits = 3) | |
original_xmlschema(fraction_digits) | |
end | |
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
private void button2_Click(object sender, EventArgs e) | |
{ | |
int i = 0; | |
while (i < 10) | |
{ | |
rc.ManualDrive(1, 1); | |
i++; | |
} |
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 | |
# get-docker-socket-from-remote <name> <user>@<host> | |
# Create a unix socket at /tmp/<name>-docker.sock which, when | |
# used will ssh to <user>@<host> and connect to the docker | |
# socket at <host>:///var/run/docker.sock | |
# Note: | |
# 1. This forks a subjob that manages the local socket. | |
# Rmember to kill that when your finished |
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
module Abominate | |
def replace_object new_object | |
raise Exception.new( "Ia! Ia! Cthulhu Fhtagn!" ) unless instance_variable_defined? "@i_know_this_is_an_abomination" | |
context = class << self ; self ; end | |
new_object.instance_variables.each do |var| | |
instance_variable_set( var, new_object.instance_variable_get( var ) ) | |
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
#title Hello World! |
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 'rubygems' | |
require 'sinatra' | |
require "sinatra/reloader" | |
get '/h' do | |
'Helllllo world!' | |
end | |
get '/t' do |