This file contains hidden or 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 |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 | |
| if __FILE__ == $0 | |
| bundle_name = ARGV[0] if (ARGV[0]) | |
| bundle_name = `pwd`.split('/').last.chomp if bundle_name.nil? | |
| bundle_name += ".git.bundle" | |
| puts "Backing up to bundle #{bundle_name}" | |
| `git bundle create ~/Dropbox/backup/git-repos/#{bundle_name} --all` | |
| end |
This file contains hidden or 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 hidden or 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 Rack | |
| class Lint | |
| def call(env = nil) | |
| @app.call(env) | |
| end | |
| end | |
| end |
This file contains hidden or 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 |
OlderNewer