Skip to content

Instantly share code, notes, and snippets.

View mimetaur's full-sized avatar

Nathan Koch mimetaur

View GitHub Profile
@paulirish
paulirish / rAF.js
Last active August 24, 2025 16:01
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'];
@sansumbrella
sansumbrella / DateUtils.cpp
Created April 24, 2011 05:35
A sane way to format dates from boost. Simple interface, no noodling with stringstreams and locales.
//
// DateUtils.cpp
// Created by David Wicks on 4/23/11.
#include "DateUtils.h"
#include <sstream>
using namespace boost::gregorian;
using namespace std;
@mbostock
mbostock / .block
Last active April 18, 2025 00:24
Google Maps + D3
license: gpl-3.0
@mcculloughsean
mcculloughsean / compile-coffeescript.watchr
Created November 27, 2010 00:57
Compiles coffeescripts to js in the background, preserving directory structure
# Run me with:
# $ watchr compile.watchr
# --------------------------------------------------
# Rules
# --------------------------------------------------
watch( '^Resources/cs/(.*\.coffee)' ) { |m| coffee m }
# --------------------------------------------------
@gruber
gruber / Liberal Regex Pattern for All URLs
Last active August 21, 2025 14:06
Liberal, Accurate Regex Pattern for Matching All URLs
The regex patterns in this gist are intended to match any URLs,
including "mailto:[email protected]", "x-whatever://foo", etc. For a
pattern that attempts only to match web URLs (http, https), see:
https://gist.github.com/gruber/8891611
# Single-line version of pattern:
(?i)\b((?:[a-z][\w-]+:(?:/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))
# printf "\033[0m0 All attributes off\033[0m\n"
# printf "\033[1m1 Bold\033[0m\n"
# printf "\033[4m4 Underline\033[0m\n"
# printf "\033[5m5 Blink\033[0m\n"
# printf "\033[7m7 Invert\033[0m\n"
# printf "\033[8m8 Hide\033[0m8 = Hide\n"
# printf "\033[30m30 Black\033[0m30 = Black\n"
# printf "\033[31m31 Red\033[0m\n"
# printf "\033[32m32 Green\033[0m\n"
# printf "\033[33m33 Yellow\033[0m\n"