Skip to content

Instantly share code, notes, and snippets.

@kotay
kotay / devices.txt
Created September 27, 2016 08:37 — forked from yas375/devices.txt
`ruby fix_names.rb > nice.csv`
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)
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)',
@kotay
kotay / Gemfile
Created July 21, 2016 09:31 — forked from chocnut/Gemfile
iOS AC + Social(Facebook) Framework & Rails(omniauth-facebook)
gem 'devise'
gem 'omniauth-facebook'
@kotay
kotay / README.md
Last active October 2, 2015 14:50 — forked from widged/README.md
Quick coloring book in SVG
@kotay
kotay / formatter.rb
Last active January 25, 2022 07:32
Heroku to Logstalgia formatter
#!/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'
@kotay
kotay / spinner.rb
Last active August 29, 2015 13:56
ruby console spinner
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"
@kotay
kotay / plugins.rb
Created February 11, 2014 11:24 — forked from mikecmpbll/plugins.rb
module Plugin1
hello("hello")
end
module PluginContainer
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
include Plugin1
module Plugins
def self.included(base)
base.class_eval do
include Plugin1
# include IdealPlugin doesn't work
# ...
hello("from plugins")
end
end
end
@kotay
kotay / progress.rb
Last active August 29, 2015 13:56
Progress
class Progress
def initialize(msg, total, &context)
@total = total
@context = context
end
def update(progress)
puts(progress)
end
@kotay
kotay / rails_resources.md
Created January 9, 2014 09:55 — forked from jookyboi/rails_resources.md
Rails-related Gems and guides to accelerate your web project.

Gems

  • 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