Skip to content

Instantly share code, notes, and snippets.

View blairanderson's full-sized avatar

Blair Anderson blairanderson

View GitHub Profile
@zhengjia
zhengjia / capybara cheat sheet
Created June 7, 2010 01:35
capybara cheat sheet
=Navigating=
visit('/projects')
visit(post_comments_path(post))
=Clicking links and buttons=
click_link('id-of-link')
click_link('Link Text')
click_button('Save')
click('Link Text') # Click either a link or a button
click('Button Value')
@cblunt
cblunt / Gemfile
Created October 21, 2011 08:55
Configure Carrierwave for Amazon S3 Storage and Heroku
# ...
gem 'carrierwave'
gem 'fog', '~> 1.0.0' # Need to specify version, as carrierwave references older (0.9.0) which doesn't allow configuration of Rackspace UK Auth URL
@SlexAxton
SlexAxton / .zshrc
Last active April 25, 2023 03:57
My gif workflow
gifify() {
if [[ -n "$1" ]]; then
if [[ $2 == '--good' ]]; then
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif
rm out-static*.png
else
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif
fi
else

#Lew's Opinionated Guide to Delivering Features#


  1. First, understand the story.

Do you understand the story completely? If not, talk to the product owner to clarify your understanding.

Is the story a logically cohesive grouping of functionality? If not, can it be broken into multiple stories?

Do the points assigned make sense given your current level of understanding of the story? If not, can it be broken into multiple stories?

@cheeyeo
cheeyeo / temp.rb
Created April 6, 2014 20:47
Using ruby tempfile to fetch a remote resource for custom formatting
class LocalResource
attr_reader :uri
def initialize(uri)
@uri = uri
end
def file
@file ||= Tempfile.new(tmp_filename, tmp_folder, encoding: encoding).tap do |f|
io.rewind
@sharonw
sharonw / csv2json.py
Created April 29, 2012 05:17
Translate MLB team schedule from csv into json
# Go to http://mlb.mlb.com/mlb/schedule/team_by_team.jsp
# Click on Regular Schedule
# Scroll down and click on Downloadable schedule
# e.g. http://sanfrancisco.giants.mlb.com/schedule/downloadable.jsp?c_id=sf&year=2012
# Download Full Season Schedule
# Suggestions for future enhancements:
# TODO: come up with a column schema way of representing the csv
# (referring to column names is more elegant than num indices)
# TODO: take file names as command line arguments
@pjb3
pjb3 / query.rb
Created March 20, 2013 14:09
It's things like this that make Ruby fun :)
class Query
def initialize
@hash = {}
end
def method_missing(name, *args)
value = args.length > 0 ? args.first : true
@hash.merge!(name => value)
self
end
@blairanderson
blairanderson / Guardfile
Last active December 14, 2015 09:49
My favorite guardfile
guard 'rspec', :cli => "--color --format nested --fail-fast --drb" do
watch(%r{^spec/.+_spec\.rb$})
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch(%r{^(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
end
@ajaswa
ajaswa / fancy-radio-buttons.css
Last active October 9, 2015 01:48
Fancy radio buttons
.radios .radio label {
background-color: #fff;
color: #666;
display: inline-block;
border: 1px solid black;
margin: 4px;
padding: 4px;
}
.radios .radio input[type='radio'] {
display: none;