Skip to content

Instantly share code, notes, and snippets.

@solnic
solnic / log.txt
Created August 19, 2012 10:03 — forked from steveklabnik/log.txt
A fun shell script from #euruku
$ history | awk {'print $2, $3, $4'} | sort | uniq -c | sort -k1 -rn | head -n 30
610 git status
568 git commit -m
491 git add .
252 git push origin
176 bundle
138 rails s
128 ls
120 git commit --amend
114 git reset --hard
@solnic
solnic / virtus-coercion.rb
Created May 11, 2012 22:00 — forked from avdi/virtus-coercion.rb
ValueObject in Virtus with a custom constructor
require 'virtus'
class Point
include Virtus::ValueObject
attribute :x, Integer
attribute :y, Integer
def initialize(value)
self.x = value[0]
@solnic
solnic / test.rb
Created January 12, 2012 11:33 — forked from tenderlove/test.rb
# encoding: utf-8
require 'rubygems'
require 'benchmark/ips'
require 'set'
TRUE_VALUES = [true, 1, '1', 't', 'T', 'true', 'TRUE'].to_set
BOOLEAN_MAP = Hash[ %w[ 1 on t true y yes ].product([ true ]) ]
def original value
@solnic
solnic / gist:1284019
Created October 13, 2011 11:34 — forked from bragi/gist:1283869
Stevey's Google Platforms Rant

I was at Amazon for about six and a half years, and now I've been at Google for that long. One thing that struck me immediately about the two companies -- an impression that has been reinforced almost daily -- is that Amazon does everything wrong, and Google does everything right. Sure, it's a sweeping generalization, but a surprisingly accurate one. It's pretty crazy. There are probably a hundred or even two hundred different ways you can compare the two companies, and Google is superior in all but three of them, if I recall correctly. I actually did a spreadsheet at one point but Legal wouldn't let me show it to anyone, even though recruiting loved it.

I mean, just to give you a very brief taste: Amazon's recruiting process is fundamentally flawed by having teams hire for themselves, so their hiring bar is incredibly inconsistent across teams, despite various efforts they've made to level it out. And their operations are a mess; they don't really have SREs and they make engineers pretty much do everything,

require 'rubygems'
gem 'dm-core', '0.10.2'
gem 'dm-migrations', '0.10.2'
gem 'dm-timestamps', '0.10.2'
require 'dm-core'
require 'dm-migrations'
require 'dm-timestamps'
@solnic
solnic / dm-dev.thor
Created July 7, 2010 09:35
DataMapper thor tasks
#!/usr/bin/env ruby -Ku
# encoding: utf-8
require 'fileutils'
require 'pathname'
require 'addressable/uri'
require 'ruby-github' # TODO: replace ruby-github with something better maintained
#!/usr/bin/env ruby
require "rubygems"
require "benchmark"
# DM Adapter
require "dm-core"
require "dm-timestamps"
require "dm-pager"