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
| package main | |
| import ( | |
| "encoding/json" | |
| "fmt" | |
| "io/ioutil" | |
| "net/http" | |
| ) | |
| func gist(id string) { |
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
| package main | |
| import ( | |
| "database/sql" | |
| "fmt" | |
| _ "github.com/Go-SQL-Driver/MySQL" | |
| "strings" | |
| ) | |
| const DbName = "go_test_db" |
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
| source 'http://rubygems.org' | |
| gem 'nokogiri' | |
| gem 'shotgun' | |
| gem 'sinatra' | |
| gem 'yajl-ruby' |
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 'celluloid' | |
| class Cat | |
| include Celluloid | |
| def initialize(name) | |
| @name = name | |
| end | |
| def speak |
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 'eventmachine' | |
| class HardWorker | |
| def initialize(name) | |
| @name = name | |
| @completion = EM::Completion.new | |
| end | |
| def work |
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 'sinatra' | |
| get '/' do | |
| haml :index | |
| end | |
| post '/' do | |
| name = params[:name].downcase | |
| if name == "jim" || name == "jim clenney" || name == "bubba" | |
| @greeting = "Yam pie for you." |
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
| defaults -currentHost write -globalDomain AppleFontSmoothing -int 3 |
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 'twitter_oauth' | |
| require 'pp' | |
| consumer_key = '<key>' | |
| consumer_secret = '<secret>' | |
| remote_id = '<id>' | |
| access_token = '<token>' | |
| user = '<screen_name>' | |
| # Add the users_lookup method |
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 | |
| branches = %x(git fetch origin && git branch --merged master) | |
| exclude = /master|test|production|staging/ | |
| deletable = branches.split("\n").select { |branch| branch.strip !~ exclude } | |
| if deletable.empty? | |
| puts 'nothing to delete :(' | |
| else |
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 'sorted_set_adapter' | |
| set = SortedSetAdapter.new | |
| set.flush | |
| set.add 1, 'foo' | |
| set.add 2, 'bar' | |
| p set.all # -> ["foo", "bar"] |
NewerOlder