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 / 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;
}
@robtarr
robtarr / mixins.scss
Created August 20, 2012 18:13
Retina/HD SASS mix-in
@mixin hd($path, $img) {
@media (-webkit-max-device-pixel-ratio: 1.49),
(-o-max-device-pixel-ratio: 3/2.01),
(max-device-pixel-ratio: 1.49) {
background-image: url($path + "/" + $img);
}
@media (-webkit-min-device-pixel-ratio: 1.5),
(-o-min-device-pixel-ratio: 3/2),
@robtarr
robtarr / fiddle.css
Created May 7, 2012 15:08
Form Validation with H5F and jQueryUI Datepicker
.valid {
background: green;
color: #fff;
}
.error {
background: red;
color: #fff;
}
@robtarr
robtarr / fiddle.css
Created May 7, 2012 14:32
Form Validation and jQueryUI Datepicker
.valid {
background: green;
color: #fff;
}
.error {
background: red;
color: #fff;
}
@robtarr
robtarr / js
Created March 26, 2012 14:01
mediaCheck.js
var mediaCheck = function(options) {
var mq,
matchMedia = window.matchMedia !== undefined;
if (matchMedia) {
mqChange = function(mq, options) {
if (mq.matches) {
options.entry();
} else {
options.exit();
@robtarr
robtarr / css
Created March 24, 2012 04:21
Responsive Navigation with Javascript
ul {
list-style: none;
}
li {
float: left;
margin-right: 20px;
}
.secondary-menu {
display: none;
@robtarr
robtarr / imp.js
Created July 25, 2015 17:32
Electric Imp Robot
var five = require('johnny-five'),
Imp = require("imp-io"),
keypress = require('keypress'),
board = new five.Board({
repl: false,
debug: false,
io: new Imp({
agent: 'FPKHeMBXeuim'
})
}),
@robtarr
robtarr / robot.js
Created July 25, 2015 14:38
Simple Johnny-Five demo
var five = require("johnny-five"),
keypress = require('keypress'),
board = new five.Board(),
stdin = process.stdin;
keypress(process.stdin);
stdin.setRawMode(true);
stdin.resume();
board.on("ready", function() {