Skip to content

Instantly share code, notes, and snippets.

View twitchy's full-sized avatar

Reeve Jolliffe twitchy

View GitHub Profile
@petermaurer
petermaurer / Name Mangler advanced snippet
Created November 22, 2012 19:42 — forked from theamnesic/Name Mangler advanced snippet
Hardcore evil characters cleaner for Name Mangler (shortened, fixed "g" equivalents, some other minor changes)
[findRegularExpression "[ÀàÁáÂâÃãÄäÅåĀāĂ㥹ǞǟǺǻ]", <name>, "a"]
[findRegularExpression "[ÆæǼǽ]", <name>, "ae"]
[findRegularExpression "[Ḃḃ]", <name>, "b"]
[findRegularExpression "[ĆćÇçČčĈĉĊċ]", <name>, "c"]
[findRegularExpression "[ḐḑĎďḊḋĐđÐðDZdzDŽdž]", <name>, "d"]
[findRegularExpression "[ÈèÉéĚěÊêËëĒēĔĕĘęĖėƷʒǮǯ]", <name>, "e"]
[findRegularExpression "[Ḟḟƒfffiflffifflſt]", <name>, "f"]
[findRegularExpression "[ǴǵĢģǦǧĜĝĞğĠġǤǥ]", <name>, "g"]
[findRegularExpression "[ĤĥĦħ]", <name>, "h"]
[findRegularExpression "[ÌìÍíÎîĨĩÏïĪīĬĭĮįİıIJij]", <name>, "i"]
@dkuppitz
dkuppitz / flatten-example.js
Created April 28, 2012 11:29
Flatten JSON objects
var flatten, obj;
flatten = require ('./flatten');
obj = {
foo: 'bar',
bar: 'foo',
foobar: {
foo: 'foo',
bar: 'bar'
}
@davidkrisch
davidkrisch / accept-xml.js
Created March 26, 2012 23:13
Express-Node: Accepting POST with Content-Type: application/xml
// This script requires Express 2.4.2
// It echoes the xml body in the request to the response
//
// Run this script like so:
// curl -v -X POST -H 'Content-Type: application/xml' -d '<hello>world</hello>' http://localhost:3000
var express = require('express'),
app = express.createServer();
express.bodyParser.parse['application/xml'] = function(data) {
return data;
@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'];
/*
* Minimal classList shim for IE 9
* By Devon Govett
* MIT LICENSE
*/
if (!("classList" in document.documentElement) && Object.defineProperty && typeof HTMLElement !== 'undefined') {
Object.defineProperty(HTMLElement.prototype, 'classList', {
get: function() {
@addyosmani
addyosmani / visibly.js
Created August 3, 2011 12:44
Cross-browser Page Visibility API polyfill
/*!
* isVis - v0.5.5 Aug 2011 - Page Visibility API Polyfill
* Copyright (c) 2011 Addy Osmani
* Dual licensed under the MIT and GPL licenses.
*/
(function () {
window.visibly = {
b: null,
q: document,
@stevenringo
stevenringo / application.sass
Created June 27, 2011 03:55
All compass stylesheet framework imports
// @import compass/css3
// @import compass/layout
// @import compass/reset
// @import compass/reset-legacy
// @import compass/support
// @import compass/typography
// @import compass/utilities
//
// @import compass/css3/appearance
// @import compass/css3/background-clip
@millermedeiros
millermedeiros / gist:882682
Created March 23, 2011 05:47
RequireJS Async Load Plugin
/*!
* RequireJS plugin for async dependency load like JSONP and Google Maps
* @author Miller Medeiros
* @version 0.0.1 (2011/03/23)
* Released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
define(function(){
function injectScript(src){
var s, t;
@nicksheffield
nicksheffield / edit_item.php
Created March 8, 2011 04:35
Edit in place using ajax and contenteditable
<?php
// quit script if you aren't accessing it with ajax
if(isset($_SERVER['HTTP_X_REQUESTED_WITH']) == false){
die();
}
// include database class
include('database.class.php');
@redoPop
redoPop / .gitignore
Created June 18, 2010 22:08
Template .gitignore file for WordPress projects
# This is a template .gitignore file for git-managed WordPress projects.
#
# Fact: you don't want WordPress core files, or your server-specific
# configuration files etc., in your project's repository. You just don't.
#
# Solution: stick this file up your repository root (which it assumes is
# also the WordPress root directory) and add exceptions for any plugins,
# themes, and other directories that should be under version control.
#
# See the comments below for more info on how to add exceptions for your