Skip to content

Instantly share code, notes, and snippets.

View joannou's full-sized avatar

Joannou Ng joannou

View GitHub Profile
@joannou
joannou / Moat Your CSS
Created February 14, 2013 18:28
How I create 'moats' to defend my CSS.
Before you do the following, use the most specific selector you can.
1. Isolate your HTML and CSS into a blank HTML document
2. For each ruleset:
1. Copy computed style (including inherited)
2. Remove -webkit properties
3. Remove your properties
4. Mix the result into your ruleset
When you update any of your properties, you should do the above again for the updated rulesets.
@joannou
joannou / lines.rb
Created August 14, 2013 20:11 — forked from kalupa/lines.rb
attr_accessible :one, :two, :three, :four, :five, :six, :seven, :eight, :nine, :ten, :eleven,
:twelve, :thirteen, :fourteen, :fifteen
@joannou
joannou / lines.rb
Created August 14, 2013 20:15 — forked from kalupa/lines.rb
attr_accessible :one,
:two,
:three,
:four,
:five,
:six,
:seven,
:eight,
:nine,
:ten,
test:
override:
- bundle exec rspec spec
deployment:
acceptance:
branch: master
commands:
- ./script/heroku_deploy.sh <ACCEPTANCE_HEROKU_APP>:
timeout: 300
@joannou
joannou / gist:ea0453f99c0d8dc011ec19d999744905
Last active September 19, 2017 16:31
To Retry Resque Jobs of a Certain Class or Exception
Resque::Failure.all(0, Resque::Failure.count).each_with_index do |failure, i|
job_string = failure['payload']['args'][0]['job_class']
exception_string = failure['exception']
p "#{i} #{job_string} #{exception_string}"
if exception_string == 'AWS::S3::SlowDown'
p "Retrying job #{i}"
Resque::Failure.requeue i
end