Skip to content

Instantly share code, notes, and snippets.

View rheaton's full-sized avatar
🍄

R Heaton rheaton

🍄
  • Relevant Healthcare
  • Victoria BC
View GitHub Profile
@rheaton
rheaton / tracker_csv_export_to_pdf.rb
Created March 30, 2011 15:38
takes a csv file from tracker and makes story cards. be careful of the order when you are cutting them up.
#!/usr/bin/env ruby
# Script to generate PDF cards suitable for planning poker
# from Pivotal Tracker [http://www.pivotaltracker.com/] CSV export.
# Inspired by Bryan Helmkamp's http://github.com/brynary/features2cards/
# Example output: http://img.skitch.com/20100522-d1kkhfu6yub7gpye97ikfuubi2.png
require 'rubygems'
@rheaton
rheaton / Gemfile
Last active October 6, 2015 22:27
emerson up and running in rails >= 3.2
gem 'emerson'
@rheaton
rheaton / gist:5861191
Created June 25, 2013 18:48
background-size mixin using IE8 polyfill
@mixin ftm-background-size($background-size-value: contain, $background-size-value-y: 100%) {
$cover-or-contain: ($background-size-value == contain) or ($background-size-value == cover);
@if $cover-or-contain {
background-size: $background-size-value;
-webkit-background-size: $background-size-value;/* Safari 3.0 */
-moz-background-size: $background-size-value; /* Gecko 1.9.2 (Firefox 3.6) */
-o-background-size: $background-size-value; /* Opera 9.5 */
} @else {
background-size: $background-size-value $background-size-value-y;
-webkit-background-size: $background-size-value $background-size-value-y;/* Safari 3.0 */
@rheaton
rheaton / email_job.rb
Last active December 22, 2015 09:39
Base Resque Job For instance methods & correct term exception handling (b/c of rails's re-raising of errors with a different class).
# example job (for emails)
class EmailJob < Jobs::Base
@queue = :mailer
attr_reader :mailer, :params, :email_type
def initialize(mailer_class, email_type, params={})
@mailer = mailer_class.constantize
@params = params.with_indifferent_access
@email_type = email_type
end
@rheaton
rheaton / Gemfile
Last active August 29, 2015 14:00
development ssl (rails 4)
#...
# gem 'unicorn'
gem 'thin'
#...
@rheaton
rheaton / application.html.erb
Created September 8, 2014 14:41
body classes
...
<body class='class-for-all-pages <%= body_classes%>'>
...
@rheaton
rheaton / history.md
Last active August 29, 2015 14:22
Emerson: Problem Solving

Browser history is hard. Even github can't get it right (I found a bug writing this: Click "Raw" and then go Back in Chrome).

##Scenario

AB test single-page-checkout vs. 3 step checkout with minimal code duplication for fewer bugs and chances to pollute the test. 3-step checkout is already in place and refactored using a combination of emerson views and traits.

<div data-view='checkout' data-checkout-path='checkout/customer'>
...
</div>
@rheaton
rheaton / SassMeister-input.scss
Created June 15, 2015 18:21
Generated by SassMeister.com.
// ----
// libsass (v3.2.5)
// ----
$small-only: only screen and (max-width: 40em);
$small-up: only screen; // everything
$medium-only: only screen and (min-width: 40.0625em) and (max-width: 64em);
$medium-up: only screen and (min-width: 40.0625em);
$large-only: only screen and (min-width: 64.0625em) and (max-width: 90em);
$large-up: only screen and (min-width: 64.0625em);
// ----
// libsass (v3.2.5)
// ----
$small-only: only screen and (max-width: 40em);
$small-up: only screen; // everything
$medium-only: only screen and (min-width: 40.0625em) and (max-width: 64em);
$medium-up: only screen and (min-width: 40.0625em);
$large-only: only screen and (min-width: 64.0625em) and (max-width: 90em);
$large-up: only screen and (min-width: 64.0625em);
puts "hello world"