Skip to content

Instantly share code, notes, and snippets.

View fedevegili's full-sized avatar

Fernando Devegili fedevegili

View GitHub Profile
@tomasdev
tomasdev / style.scss
Created May 25, 2014 22:12
Compass Sprites with Retina support
// Only requirement: save all your .png files in 2x format. As this uses background-size, only IE9+ supported, but will look nice for both retina and non retina devices.
// Just because I like to use <span>s
.icon-sprite {
display: inline-block;
}
// Compass automagically generate sprites
@import 'icon/*.png';
// Override the mixin Compass core uses to generate the width/height/position and include background-size
@mixin sprite-background-position($map, $sprite, $offset-x, $offset-y, $fifth) {
$ypos: round(nth(sprite-position($map, $sprite), 2) / 2);
@runemadsen
runemadsen / sinon.js
Created April 15, 2013 20:48
Using sinon.js to fake calls to multiple URLs in a test
var server = sinon.fakeServer.create();
var result1;
var result2;
server.respondWith("url/one", '{ "id": 1 }');
server.respondWith("url/two", '{ "id": 2 }');
$.getJSON('url/one', function(data) {
result1 = data;
});