Interactive version: http://bl.ocks.org/4545199
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
iPhone1,1 iPhone | |
iPhone1,2 iPhone 3G | |
iPhone2,1 iPhone 3GS | |
iPhone3,1 iPhone 4 (GSM) | |
iPhone3,3 iPhone 4 (CDMA) | |
iPhone4,1 iPhone 4S | |
iPhone5,1 iPhone 5 (A1428) | |
iPhone5,2 iPhone 5 (A1429) | |
iPhone5,3 iPhone 5c (A1456/A1532) | |
iPhone5,4 iPhone 5c (A1507/A1516/A1529) |
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
IOS_DEVICES = { | |
'iPhone1,1' => 'iPhone 1G', | |
'iPhone1,2' => 'iPhone 3G', | |
'iPhone2,1' => 'iPhone 3GS', | |
'iPhone3,1' => 'iPhone 4', | |
'iPhone3,3' => 'iPhone 4 (Verizon)', | |
'iPhone4,1' => 'iPhone 4S', | |
'iPhone5,1' => 'iPhone 5 (GSM)', | |
'iPhone5,2' => 'iPhone 5 (GSM+CDMA)', | |
'iPhone5,3' => 'iPhone 5C (GSM)', |
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
gem 'devise' | |
gem 'omniauth-facebook' |
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 | |
# Install: | |
# $ cat heroku_logstalgia_formatter.rb > ~/bin/heroku_logstalgia_formatter | |
# $ chmod +x ~/bin/heroku_logstalgia_formatter | |
# Usage: | |
# $ heroku logs -t --app {app} | heroku_logstalgia_formatter | logstalgia - | |
require 'optparse' |
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 with_spinner | |
finished = false | |
working = Mutex.new | |
spinner = Thread.new do | |
loop do | |
break if working.synchronize {finished} | |
["|","/","-","\\"].each do |glyph| | |
print "\r#{glyph}" | |
sleep 0.07 | |
print "\b" |
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 Plugin1 | |
hello("hello") | |
end | |
module PluginContainer | |
def self.included(base) | |
base.extend(ClassMethods) | |
end | |
module ClassMethods | |
include Plugin1 |
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 Plugins | |
def self.included(base) | |
base.class_eval do | |
include Plugin1 | |
# include IdealPlugin doesn't work | |
# ... | |
hello("from plugins") | |
end | |
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 Progress | |
def initialize(msg, total, &context) | |
@total = total | |
@context = context | |
end | |
def update(progress) | |
puts(progress) | |
end |
- Bundler - Bundler maintains a consistent environment for ruby applications. It tracks an application's code and the rubygems it needs to run, so that an application will always have the exact gems (and versions) that it needs to run.
- rabl - General ruby templating with json, bson, xml, plist and msgpack support
- Thin - Very fast and lightweight Ruby web server
- Unicorn - Unicorn is an HTTP server for Rack applications designed to only serve fast clients on low-latency, high-bandwidth connections and take advantage of features in Unix/Unix-like kernels.
- SimpleCov - SimpleCov is a code coverage analysis tool for Ruby 1.9.
- Zeus - Zeus preloads your Rails app so that your normal development tasks such as console, server, generate, and specs/tests take less than one second.
- [factory_girl](h
NewerOlder