Skip to content

Instantly share code, notes, and snippets.

View gavinblair's full-sized avatar

Gavin Blair gavinblair

View GitHub Profile
div {
@include image-2x("logo.png", "logo2x.png");
}
@mixin image-2x($image1, $image2) {
background-image: url($image);
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
background-image: url($image2);
background-size: image-width($image1) image-height($image1);
}
@gavinblair
gavinblair / jquery.referrer.js
Created October 4, 2012 15:05 — forked from SeanJA/jquery.referrer.js
Get the referrer with jQuery: A useless bookmarklet
javascript:(function(){ jQuery.fn.referrer = function() { return jQuery(document).prop("referrer").toString(); }; alert(jQuery().referrer()); })();
@gavinblair
gavinblair / LICENSE.txt
Created February 16, 2012 15:44 — forked from 140bytes/LICENSE.txt
140byt.es -- Click ↑↑ fork ↑↑ to play!
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
Version 2, December 2004
Copyright (C) 2011 YOUR_NAME_HERE <YOUR_URL_HERE>
Everyone is permitted to copy and distribute verbatim or modified
copies of this license document, and changing it is allowed as long
as the name is changed.
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE
@gavinblair
gavinblair / random_math_question_positive_only.php
Created June 6, 2011 17:26 — forked from SeanJA/random_math_question_positive_only.php
Generate a random math question that always has a positive answer
<?php
$ops = array('-', '+');
$answer = -1;
while($answer < 0 || $answer > 99) {
$num1 = rand(0, 100);
$num2 = rand(0, 100);
$num1 -= 50;
$num2 -= 50;