Skip to content

Instantly share code, notes, and snippets.

View benkeen's full-sized avatar

Ben Keen benkeen

View GitHub Profile
@eduardocereto
eduardocereto / cb_addEventListener.js
Created May 4, 2011 17:45
a cross-browser implementation of addEventListener/AttachEvent without external dependencies
/**
* Cross Browser helper to addEventListener.
*
* @param {HTMLElement} obj The Element to attach event to.
* @param {string} evt The event that will trigger the binded function.
* @param {function(event)} fnc The function to bind to the element.
* @return {boolean} true if it was successfuly binded.
*/
var cb_addEventListener = function(obj, evt, fnc) {
// W3C model
@ScottPhillips
ScottPhillips / .htaccess
Created February 2, 2012 04:30
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/
@doginthehat
doginthehat / gist:1890659
Last active May 12, 2023 20:13
compare block helper for handlebars
// {{compare unicorns ponies operator="<"}}
// I knew it, unicorns are just low-quality ponies!
// {{/compare}}
//
// (defaults to == if operator omitted)
//
// {{equal unicorns ponies }}
// That's amazing, unicorns are actually undercover ponies
// {{/equal}}
// (from http://doginthehat.com.au/2012/02/comparison-block-helper-for-handlebars-templates/)
@p0rsche
p0rsche / gist:2763377
Created May 21, 2012 17:17
jQuery.extend implementation in pure JS
var utils = function(){
"use strict";
var _class2type = {};
var _type = function( obj ) {
return obj == null ?
String( obj ) :
_class2type[ toString.call(obj) ] || "object";
};
@rjcorwin
rjcorwin / simple-file-attachment-for-couchdb.html
Created November 14, 2012 20:03
A very basic example in Javascript of how to attach a file to a CouchDB document. This will work wether or not the Document ID you define exists.
<!DOCTYPE html>
<! --
A very basic example in Javascript of how to attach a file to a CouchDB document. This will work wether or not the Document ID you define exists.
Log in at /_utils, upload this file to a document, and then view it for your own uploader. See the code for comments. ajaxSubmit() is the magic that attaches
as long as the Couch Doc exists because you can't submit a new Couch Document with an attachment.
by @rjsteinert http://rjsteinert.com
-->
<html xmlns="http://www.w3.org/1999/xhtml">
Agostini
Aiello
Albanese
Amato
Antonelli
Arena
Baldi
Barbieri
Barone
Basile
@marciuz
marciuz / first_name_ITA_F.txt
Created June 27, 2013 06:41
List of common italians first names (females)
Alessandra
Alessia
Alice
Angela
Anna
Arianna
Aurora
Beatrice
Camilla
Caterina
@marciuz
marciuz / first_name_ITA_M.txt
Created June 27, 2013 06:42
List of common italians first names (males)
Alberto
Alessandro
Alessio
Alex
Andrea
Angelo
Antonio
Armando
Augusto
Christian
@marciuz
marciuz / nom_famille_FR.txt
Created June 27, 2013 06:48
Nom de famille (last names) France
Adam
Albert
Andre
Arnaud
Aubert
Aubry
Bailly
Barbier
Baron
Barre
@marciuz
marciuz / prenom_F
Created June 27, 2013 06:55
List of common french first names (female)
Agathe
Alexandra
Alexia
Alice
Alicia
Amandine
Ambre
Amélie
Anaël
Anaëlle