Skip to content

Instantly share code, notes, and snippets.

@paulirish
paulirish / rAF.js
Last active March 22, 2024 00:00
requestAnimationFrame polyfill
// http://paulirish.com/2011/requestanimationframe-for-smart-animating/
// http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating
// requestAnimationFrame polyfill by Erik Möller. fixes from Paul Irish and Tino Zijdel
// MIT license
(function() {
var lastTime = 0;
var vendors = ['ms', 'moz', 'webkit', 'o'];
@sergiolopes
sergiolopes / README.md
Created February 28, 2012 21:57
Pure CSS fix to iOS zoom bug on device rotation

My approach to fix the iOS bug is documented here:

https://github.com/sergiolopes/ios-zoom-bug-fix

Here I present one experiment with a pure CSS solution, no JS required. It uses width=device-width normally (no device-height hacking) and scales down the page on landscape.

Works fine on all iOS versions.

There's only one problem: on old iOS versions (prior to 4.3.5), the page will get a big empty space at bottom, below the content, when on landscape. Recent iOS versions don't show this behavior.

@stubbornella
stubbornella / css-stats-ack.sh
Created October 1, 2012 22:07 — forked from pjkix/css-stats-ack.sh
shell script to generate some css file statistics
#!/bin/bash
## v1.0.6
## this script will gernerate css stats
### example output
# CSS STATS
# ----------
# Floats: 132
@ryndel
ryndel / handlebars.linkify.js
Created October 14, 2012 01:17
Handlebars.js: linkify helper #cc #handlebars
Handlebars.registerHelper('linkify', function (text) {
text = text.replace(/(https?:\/\/\S+)/gi, function (s) {
return '<a href="' + s + '">' + s + '</a>';
});
text = text.replace(/(^|)@(\w+)/gi, function (s) {
return '<a href="http://twitter.com/' + s + '">' + s + '</a>';
});
text = text.replace(/(^|)#(\w+)/gi, function (s) {
@murtaugh
murtaugh / 1. single-line.html
Last active April 21, 2021 16:23
Blockquote patterns for ALA
<figure class="quote">
<blockquote>It is the unofficial force—the Baker Street irregulars.</blockquote>
</figure>
@wouterj
wouterj / post.md
Last active July 13, 2021 02:00
How to use Jekyll, Plugins and Sass on GitHub Pages

How to use Jekyll, Plugins and Sass on GitHub Pages

Jekyll is a great CMS for developers and GitHub Pages is a great host to store your Jekyll sites. There is just one problem, GitHub runs Jekyll in safe mode, which means you can't use plugins. One thing you can do is building the Jekyll website locally and then push to GitHub.

Alexandre Rademaker found a solution to do this easially, which is quite usefull: "GitHub Pages and Jekyll plugins" After reading this I thought, that can be done easier!

Aliases to rescue

Git provides a way to have aliases of bash commands. You can do this by adding items to the alias key of your configuration. For this, you can add this locally by adding this lines to your %PROJECT_ROOT%/.git/config file:

// if (!window.L) { window.L = function () { console.log(arguments);} } // optional EZ quick logging for debugging
/**
* A modified (improved?) version of the jQuery plugin design pattern
* See http://docs.jquery.com/Plugins/Authoring (near the bottom) for details.
*
* ADVANTAGES OF EITHER FRAMEWORK:
* - Encapsulates additional plugin action methods without polluting the jQuery.fn namespace
* - Ensures ability to use '$' even in compat modes
*
@markgoodyear
markgoodyear / 01-gulpfile.js
Last active May 5, 2023 03:21
Comparison between gulp and Grunt. See http://markgoodyear.com/2014/01/getting-started-with-gulp/ for a write-up.
/*!
* gulp
* $ npm install gulp-ruby-sass gulp-autoprefixer gulp-cssnano gulp-jshint gulp-concat gulp-uglify gulp-imagemin gulp-notify gulp-rename gulp-livereload gulp-cache del --save-dev
*/
// Load plugins
var gulp = require('gulp'),
sass = require('gulp-ruby-sass'),
autoprefixer = require('gulp-autoprefixer'),
cssnano = require('gulp-cssnano'),
@pascalpp
pascalpp / backbone.when.js
Last active August 29, 2015 13:57
Backbone.When
define(function(require) {
'use strict';
/* MODULE DEPENDENCIES */
var Backbone = require('backbone'),
_ = require('underscore');
/*
Backbone.When
2014-02-20 by pascal
@jeffmo
jeffmo / gist:054df782c05639da2adb
Last active January 11, 2024 06:05
ES Class Property Declarations