Skip to content

Instantly share code, notes, and snippets.

@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) {
@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
@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.

@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'];