Skip to content

Instantly share code, notes, and snippets.

View robtarr's full-sized avatar

Rob Tarr robtarr

View GitHub Profile
@robtarr
robtarr / gist:4002086
Created November 2, 2012 15:39
When gems are borked
gem list | cut -d" " -f1 | xargs gem uninstall -aIx
*If this doesn't work - blame Don.
@robtarr
robtarr / gist:4087809
Created November 16, 2012 14:40
Access Rails config strings
msgs = YAML::load(File.open("#{::Rails.root.to_s}/config/locales/devise.en.yml"))
msgs['en']['devise']['failure']['unauthenticated']
@robtarr
robtarr / rem-fix.scss
Last active December 11, 2015 03:39
Working on rem-fix SCSS mixin
@mixin rem( $property, $a:0, $b:$a, $c:$a, $d:$b ) {
@if ( $property == "font-size" ) {
// $a is the font size
// %b is the keyword
@if ( $a != $b ) {
font-size: $b;
}
@else {
font-size: $a * $base-font-multiplier * 16px;
}
@robtarr
robtarr / rwd_nav.md
Last active December 16, 2015 15:59
Responsive Navigation
def clear_cache domain
domain_parts = domain.match(/(?:[^:]*:\/\/)?([^\/]+\.[^\/]+)/)
domain = domain_parts[1]
Net::HTTP.get(domain, "/")
end
class Player
def initialize
@last_health = 20
end
def play_turn(warrior)
move = MoveAction.new warrior
health = HealthAction.new warrior
### Keybase proof
I hereby claim:
* I am robtarr on github.
* I am robtarr (https://keybase.io/robtarr) on keybase.
* I have a public key whose fingerprint is 964A 0CC8 1AD5 7FFB A73B 68E7 7049 CA37 8F8E 8717
To claim this, I am signing this object:
@robtarr
robtarr / geocode.gs
Created April 17, 2014 13:35
Geocoding script for Google Drive Spreadsheets
function geoCode(addr){
var gc = Maps.newGeocoder();
var geoJSON = gc.geocode(addr);
var lat = geoJSON.results[0].geometry.location.lat;
var lng = geoJSON.results[0].geometry.location.lng;
return lat + ", " + lng;
}