Skip to content

Instantly share code, notes, and snippets.

function interval(func, wait, times){
var interv = function(w, t){
return function(){
if( typeof t === "undefined" || t-- > 0 ){
setTimeout(interv, w);
try {
func.call(null);
}
catch(e) {
t = 0;
@amboy00
amboy00 / gruntfile.js
Last active December 27, 2015 00:38
How I use Spritesmith to with retina displays on my Yeoman setup. https://github.com/Ensighten/grunt-spritesmith
grunt.initConfig({
sprite: {
sprite_large: {
src: '<%= yeoman.app %>/images/sprites-2x/*.{png,jpg,gif}',
destImg: '<%= yeoman.app %>/images/sprites-2x.png',
destCSS: '<%= yeoman.app %>/styles/_sprites-2x.scss',
imgPath: '../images/sprites-2x.png',
'cssVarMap': function (sprite) {
sprite.name = 'sprite-' + sprite.name;
},
@amboy00
amboy00 / key.js
Created October 10, 2013 20:58
Not sure entirely what this does, but keeping it anyway.
$(document).ready(function(){
// Disable page scrolling
$("html").css({'overflow': 'hidden'});
// Block arrow keys scrolling
document.onkeydown = function(e) {
if (!e) e = window.event;
if(e){ // IE8 and earlier
if(e.keyCode){
@amboy00
amboy00 / log.js
Created October 1, 2013 14:54
Found this in an old file, don't know where it came from.
var log = function(obj) {
if (typeof window.console === 'object' && typeof window.console.log === 'function') {
window.console.log(obj);
}
}
<div class="large-padding-6-8 medium-padding-3-5 small-padding-2-3"></div>
<ul class="large-block-grid-4 small-block-grid-3">
<li><img src="images/1.png"></li>
<li><img src="images/2.png"></li>
<li><img src="images/3.png"></li>
<li><img src="images/4.png"></li>
<li><img src="images/5.png"></li>
<li><img src="images/6.png"></li>
<li><img src="images/7.png"></li>
<li><img src="images/8.png"></li>
<li><img src="images/9.png"></li>
<div class="row">
<div class="large-11 large-uncentered medium-3 medium-centered small-6 small-centered columns"></div>
</div>
<div class="row">
<div class="large-1 medium-1 small-1 columns"></div>
<div class="large-10 large-offset-1 medium-10 medium-offset-1 small-10 small-offset-1 columns"></div>
</div>
<div class="row">
<div class="large-1 medium-1 small-1 columns"></div>
<div class="large-9 large-offset-2 medium-9 medium-offset-2 small-9 small-offset-2 columns"></div>
</div>
<div class="row">
<div class="large-1 medium-1 small-1 columns"></div>
@amboy00
amboy00 / WebKit-retina-CSS-bug.markdown
Created September 13, 2013 15:01
A Pen by Chris Williams.

WebKit retina CSS bug

Webkit has a bug that makes elements blurry when inside a parent that uses -webkit-filter: yadda yadda yadda;. The work around is to set the child elements to -webkit-backface-visibility: hidden;.

A Pen by Chris Williams on CodePen.

License.

@amboy00
amboy00 / font-mixin.scss
Created September 10, 2013 14:53
A brief mixin to handle web fonts from typography.com @include main-font('light', 'italic');
@mixin main-font($type, $style) {
font-family: 'Verlag A', 'Verlag B', sans-serif;
@if( $type == "light") {
font-weight: 300;
} @else {
font-weight: 700;
}
@if( $style == 'normal' ) {