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
## FriendlyId 5.0 | |
------------------------------------------------------------------------ | |
Using ruby 2.0.0 AR 4.0.0 with sqlite3 (in-memory) | |
Rehearsal ------------------------------------------------------------------------- | |
find (without FriendlyId) 0.410000 0.000000 0.410000 ( 0.412285) | |
find (in-table slug) 0.890000 0.000000 0.890000 ( 0.911959) | |
find (in-table slug; finders addon) 0.670000 0.010000 0.680000 ( 0.686639) | |
find (external slug) 1.660000 0.040000 1.700000 ( 1.721548) | |
insert (without FriendlyId) 0.960000 0.010000 0.970000 ( 0.977678) |
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 'https://rubygems.org' | |
gem 'delayed_job' | |
gem 'delayed_job_active_record' | |
gem 'daemons' | |
gem 'pg' |
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
" File Name: removeTrailingSpace.vim | |
" | |
" Author: Sudipta Ghorui <[email protected]> | |
" | |
" Credits: Bitan Kundu <[email protected]> | |
" who always suggested me to do this manualy | |
" | |
" Last Modified: 05 May 2006 | |
" | |
" Description: removes the trailing space from the file when user will save |
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
# before | |
class Date | |
def first_business_day_of_month | |
date = beginning_of_month | |
loop do | |
return date if date.workday? | |
date = date.next | |
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
require "ffaker" | |
require 'thread' | |
class ConcurrentHash | |
def initialize | |
@reader, @writer = {}, {} | |
@lock = Mutex.new | |
end | |
def [](key) |
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 "ffaker" | |
require 'thread' | |
# Taken from Josh Peek's code at: http://stackoverflow.com/questions/1080993/pure-ruby-concurrent-hash | |
class ConcurrentHash | |
def initialize | |
@reader, @writer = {}, {} | |
@lock = Mutex.new | |
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
bundle exec ./bench.rb | |
Using Haml 3.1.8 (Separated Sally) | |
Template: /Users/norman/work/haml-bench/standard.haml | |
Darwin Normans-MacBook-Pro.local 12.2.0 Darwin Kernel Version 12.2.0: Sat Aug 25 00:48:52 PDT 2012; root:xnu-2050.18.24~1/RELEASE_X86_64 x86_64 | |
ruby 1.9.3p374 (2013-01-15 revision 38858) [x86_64-darwin12.2.0] | |
------------------------------------------------------------------------ | |
1000 Iterations | |
Rehearsal -------------------------------------------------------- | |
compiled haml pretty 0.770000 0.020000 0.790000 ( 0.924422) |
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 "rubygems" | |
require "tzinfo" | |
input = '1/31/13 13:34' | |
format = '%m/%d/%y %H:%M' | |
zone = TZInfo::Timezone.get('America/Los_Angeles') | |
local = DateTime.strptime(input, format) | |
utc = zone.local_to_utc(local) | |
output = utc.iso8601 |
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
http://d3.minus.com/1341336326/SNLI5co7KKoIjMjzrX2SGg/dD0pIYLgWF7lV/One-Click-G2x-recovery-flasher-04-28-12.rar |
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 "haml" | |
Haml::Helpers::HTML_ESCAPE['&'] = '&' | |
Haml::Engine.new(%q{%a(href='/posts' data-icon="&" aria-hidden='true')}).render | |
=> "<a aria-hidden='true' data-icon='&' href='/posts'></a>\n" |