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
56k: "https://123.campfirenow.com/images/56k.gif" | |
bell: ":bell:" | |
bezos: ":laughing::thought_balloon:" | |
bueller: "anyone?" | |
clowntown: "https://123.campfirenow.com/images/clowntown.gif" | |
crickets: "hears crickets chirping" | |
dangerzone: "https://123.campfirenow.com/images/dangerzone.png" | |
danielsan: ":fireworks: :trophy: :fireworks:" | |
deeper: "https://123.campfirenow.com/images/top.gif" | |
drama: "https://123.campfirenow.com/images/drama.jpg" |
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
var program = require('commander'), | |
request = require('request'), | |
fs = require('fs'), | |
ursa = require('ursa'); | |
program.on('--help', function() { | |
console.log(' Alternative to https://gist.github.com/fbb99b638e9da27fe24d (generate secure environment variables)'); | |
console.log(' Example:'); | |
console.log(''); | |
console.log(' $ node index -r github-user/user-repo -v SECURE=value'); |
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 Base | |
def call | |
'call' | |
end | |
end | |
p Base.new.call #=> "call" | |
# Monkeypatching "works" but doesn't provide access to #super |
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 'sinatra' | |
require 'active_support' | |
require 'logger' | |
class SinatraTest < Sinatra::Application | |
module RedirectedLogger | |
def self.logger=(value) | |
Thread.current['sinatra.logger'] = value | |
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
source "http://rubygems.org/" | |
gem "sinatra", "~> 1.3.0" | |
gem "thin" |
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
######################################### | |
# Very basic rack application showing how to use a router based on the uri | |
# and how to process requests based on the HTTP method used. | |
# | |
# Usage: | |
# $ rackup rack_example.ru | |
# | |
# $ curl -X POST -d 'title=retire&body=I should retire in a nice island' localhost:9292/ideas | |
# $ curl -X POST -d 'title=ask Satish for a gift&body=Find a way to get Satish to send me a gift' localhost:9292/ideas | |
# $ curl localhost:9292/ideas |
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
######################################### | |
# Very basic sinatra application showing how to use a router based on the uri | |
# and how to process requests based on the HTTP method used. | |
# | |
# Usage: | |
# $ ruby rack_example.rb | |
# | |
# $ curl -X POST -d 'title=retire&body=I should retire in a nice island' localhost:4567/ideas | |
# $ curl -X POST -d 'title=ask Satish for a gift&body=Find a way to get Satish to send me a gift' localhost:4567/ideas | |
# $ curl localhost:9292/ideas |
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 'sinatra' | |
# before we process a route, we'll set the response as | |
# plain text and set up an array of viable moves that | |
# a player (and the computer) can perform | |
before do | |
content_type :txt | |
@defeat = {rock: :scissors, paper: :rock, scissors: :paper} | |
@throws = @defeat.keys | |
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
describe LeadService do | |
LeadService.configure(:test) do | |
before { settings.set(:instance, self) } | |
end | |
# Required for Rack::Test | |
# | |
def app | |
LeadService |
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 version 51.0 (51) | |
// access flags 0x21 | |
public class example extends org/jruby/ast/executable/AbstractScript { | |
// compiled from: example.rb | |
// debug info: /home/tim/example.rb | |
// access flags 0x100A | |
private static setPosition(Lorg/jruby/runtime/ThreadContext;I)V | |
ALOAD 0 |
NewerOlder