Skip to content

Instantly share code, notes, and snippets.

/Users/lifeiscontent/.rvm/gems/ruby-1.9.3-p286@apartmentlist/gems/scss-lint-0.6.6/lib/scss_lint/runner.rb:38:in `find_lints': /Users/lifeiscontent/.rvm/gems/ruby-1.9.3-p286@apartmentlist/gems/scss-lint-0.6.6/lib/scss_lint/engine.rb:5: odd number list for Hash (SyntaxError)
ENGINE_OPTIONS = { cache: false, syntax: :scss }
^
/Users/lifeiscontent/.rvm/gems/ruby-1.9.3-p286@apartmentlist/gems/scss-lint-0.6.6/lib/scss_lint/engine.rb:5: syntax error, unexpected ':', expecting '}'
ENGINE_OPTIONS = { cache: false, syntax: :scss }
^
/Users/lifeiscontent/.rvm/gems/ruby-1.9.3-p286@apartmentlist/gems/scss-lint-0.6.6/lib/scss_lint/engine.rb:5: Can't assign to false
ENGINE_OPTIONS = { cache: false, syntax: :scss }
^
/Users/lifeiscontent/.rvm/gems/ruby-1.9.3-p286@apartmentlist/gems/scss-lint-0.6.6/lib/scss_lint/engine.rb:5: syntax error, unexpected ':', expecting '='
> rvm use ruby-1.9.3-p392 ; for x in 1 2 3 4 5 6 7 8; do time be rails runner "print nil"; done
Using /Users/derwiki/.rvm/gems/ruby-1.9.3-p392
bundle exec rails runner "print nil" 6.79s user 1.41s system 90% cpu 9.111 total
bundle exec rails runner "print nil" 6.50s user 1.33s system 89% cpu 8.708 total
bundle exec rails runner "print nil" 6.65s user 1.34s system 90% cpu 8.863 total
bundle exec rails runner "print nil" 7.15s user 1.49s system 90% cpu 9.548 total
bundle exec rails runner "print nil" 6.48s user 1.35s system 90% cpu 8.688 total
bundle exec rails runner "print nil" 6.55s user 1.34s system 90% cpu 8.754 total
bundle exec rails runner "print nil" 6.27s user 1.28s system 89% cpu 8.423 total
bundle exec rails runner "print nil" 6.10s user 1.24s system 89% cpu 8.216 total
Tests
- what tests do we want to write?
- write up a test plan
- did we write a testable solution
- do we want to test this on staging?
Design
- Did we follow coding standards
- Did we follow product/design standards
- How could this fail? How do we want to handle these failures?
/sbin/ping www.google.com ~@macbookair.local
PING www.google.com (74.125.132.99): 56 data bytes
Request timeout for icmp_seq 0
Request timeout for icmp_seq 1
Request timeout for icmp_seq 2
Request timeout for icmp_seq 3
64 bytes from 74.125.132.99: icmp_seq=0 ttl=46 time=4933.622 ms
64 bytes from 74.125.132.99: icmp_seq=1 ttl=46 time=4622.371 ms
64 bytes from 74.125.132.99: icmp_seq=2 ttl=46 time=4541.835 ms
64 bytes from 74.125.132.99: icmp_seq=3 ttl=46 time=4923.432 ms

Ad Groups

Create a different ad group for keywords so that the advertisement displayed is as close of a match as possible. For example,

"rent cameras" => "Rent Camera Gear" "rent lenses" => "Rent Camera Lenses" "rent cameras sf" => "Rent Cameras in San Francisco" "rent nikon" => "Rent Name Brand Cameras" "rent canon" => "Rent Rebels and Name Branc Cameras"

module RedisFriends
def self.key user_id
"redis_friends:#{ user_id }"
end
def self.sync_friend_ids user_id, friend_ids
REDIS.multi do
REDIS.sadd key(user_id), friend_ids
friend_ids.each { |friend_id| REDIS.sadd key(friend_id), user_id }
end
@derwiki
derwiki / generate-swarm.sh
Created February 15, 2013 23:11
Series of commands (not an executable script per se) to get you from a git repository to a Code Swarm AVI (tested on Linux and OS X).
CODESWARM_DIR="/home/user/src/code_swarm/"
# extract from your git repo
git log --name-status --pretty=format:'%n------------------------------------------------------------------------%nr%h | %ae | %ai (%aD) | x lines%nChanged paths:' > $CODESWARM_DIR/data/activity.log
# convert to XML for CodeSwarm
python convert_logs/convert_logs.py \
-g $CODESWARM_DIR/data/activity.log -o $CODESWARM_DIR/data/activity.xml
# create a new config that points to the correct input XML and saves snapshots
class Item < ActiveRecord::Base
attr_accessible :description, :owner_id, :title, :image_url, :weekly, :daily,
:amazon_url, :image, :brand, :component
belongs_to :owner, class_name: 'User'
COMPONENTS = [:lens, :body, :accessory].each do |component|
scope component.to_sym, where(component: component)
end
BRANDS = [:canon, :nikon, :sony, :olympus, :other].each do |brand|
scope brand.to_sym, where(brand: brand)
#!/usr/bin/env ruby
def file_variable(filename)
File.readlines(filename, 'r').first.to_i
end
TARGET_TABLE = 'action_credits'
SCHEMA = <<-SQL
CREATE TABLE IF NOT EXISTS `action_credits` (
.. omitted for brevity ..