Skip to content

Instantly share code, notes, and snippets.

View robtarr's full-sized avatar

Rob Tarr robtarr

View GitHub Profile
class Player
def initialize
@last_health = 20
end
def play_turn(warrior)
move = MoveAction.new warrior
health = HealthAction.new warrior
def clear_cache domain
domain_parts = domain.match(/(?:[^:]*:\/\/)?([^\/]+\.[^\/]+)/)
domain = domain_parts[1]
Net::HTTP.get(domain, "/")
end
@robtarr
robtarr / rwd_nav.md
Last active December 16, 2015 15:59
Responsive Navigation
@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 / 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 / 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 / group.css
Created September 7, 2012 13:33
SASS Grouping function
.elementA:before,
.elementB:before,
.elementA:after,
.elementB:after { content: ""; display: table; }
.elementA:after
.elementB:after { clear: both; }
.elementA,
.elementB { *zoom: 1; }
@robtarr
robtarr / _mixins.scss
Created August 24, 2012 19:41
SCSS mixin for REMs (done with jondaiello)
@mixin rem-width( $em-size ) {
width: $em-size * $base-font-multiplier * 16px;
width: $em-size * 1rem;
}