Skip to content

Instantly share code, notes, and snippets.

Blair Anderson blairanderson

Block or report user

Report or block blairanderson

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@cheeyeo
cheeyeo / temp.rb
Created Apr 6, 2014
Using ruby tempfile to fetch a remote resource for custom formatting
View temp.rb
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
View Lews_guide_to_delivering.md

#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?

@pjb3
pjb3 / query.rb
Created Mar 20, 2013
It's things like this that make Ruby fun :)
View query.rb
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 Dec 14, 2015
My favorite guardfile
View 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
@SlexAxton
SlexAxton / .zshrc
Last active Nov 22, 2019
My gif workflow
View .zshrc
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
@ajaswa
ajaswa / fancy-radio-buttons.css
Last active Oct 9, 2015
Fancy radio buttons
View fancy-radio-buttons.css
.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;
@sharonw
sharonw / csv2json.py
Created Apr 29, 2012
Translate MLB team schedule from csv into json
View csv2json.py
# 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
@cblunt
cblunt / Gemfile
Created Oct 21, 2011
Configure Carrierwave for Amazon S3 Storage and Heroku
View Gemfile
# ...
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
@mikegehard
mikegehard / 0_README.md
Created May 5, 2011 — forked from netzpirat/0_README.md
Continuous CoffeeScript testing with Guard and Jasmine
View 0_README.md

Continuous CoffeeScript testing with Guard and Jasmine

This Gist shows how to set up a Rails project to practice BDD with CoffeeScript, Guard and Jasmine. You can see this setup in action on Vimeo

  • Install Gems with Bundler with bundle install
  • Define your guards with mate Guardfile
  • Initialize Jasmine with bundle exec jasmine init
  • Configure Jasmine with mate spec/support/yasmine.ym
  • Start Guard with bundle exec guard
You can’t perform that action at this time.