Skip to content

Instantly share code, notes, and snippets.

$('.hidden ul li')
.each(
function(index, element) {
$(element)
.click(
function() {
alert(index);
})
.fadeIn(index * 900)
.css('margin-left', (40 * index) + 'px');
var log = function(msg) {
window.console &&
typeof console.log === 'function' &&
console.log(msg);
};
// http://tlrobinson.net/blog/2008/10/wrapping-javascript-callbacks/
function callbackWrap(object, property, argumentIndex, wrapperFactory, extra) {
var original = object[property];
object[property] = function() {
function User1( name, age ){
this.name = name;
this.age = age;
}
// Add a new function to the object prototype
User1.prototype.getName = function(){
return this.name;
};
User1.prototype.getAge = function(){
return this.age;
.viewTagOptions::-webkit-scrollbar {
width: 8px;
}
.viewTagOptions::-webkit-scrollbar-thumb {
background-color: rgba(0, 0, 0, 0.1);
-webkit-border-radius: 4px;
}
var chars = ['#', '&', ';', ':', '/', '\\', '\'', '"', 'A',
'À', 'Á', 'Â', 'Ã', 'Ä', 'Å', 'Æ', 'Ç',
'È', 'É', 'Ê', 'Ë',
'Ì', 'Í', 'Î', 'Ï',
'Ð', 'Ñ', 'Ò', 'Ó', 'Ô', 'Õ', 'Ö',
'×', 'Ø', 'Ù', 'Ú', 'Û', 'Ü',
'Ý', 'Þ', 'ß',
'à', 'á', 'â', 'ã', 'ä', 'å',
'æ', 'ç', 'è', 'é', 'ê', 'ë',
'ì', 'í', 'î', 'ï',
@jwalsh
jwalsh / foo.js
Created September 11, 2012 17:30
(function() {
var defaults = {
bk_meta_vars: [],
bk_js_list: [],
bk_pixel_limit: 15,
bk_ignore_meta: true,
bk_allow_multiple_calls: false,
bk_ignore_outside_iframe: false
};
/**
* allCookies.setItem(sKey, sValue, vEnd, sPath, sDomain, bSecure)
*
* @argument sKey (String): the name of the cookie;
* @argument sValue (String): the value of the cookie;
* @optional argument vEnd (Number - finite or Infinity, String, Date object or null): the max-age in seconds (e.g.
* 31536e3 for a year) or the expires date in GMTString format or in Date Object format; if not specified it will
* expire at the end of session;
* @optional argument sPath (String or null): e.g., "/", "/mydir"; if not specified, defaults to the current path
* of the current document location;
<html>
<head>
<meta name="viewport" content="width=device-width; initial-scale=1.0; user-scalable=no;">
<style type='text/css'>
.center {
#!/bin/bash
# Make a static clone the working copy of a Jenkins build
# to a public directory for browser testing.
# Also cleans clones older than 14 days
#
# Parameters:
# $1: Publish target (absolute path, without "$1")
# $2: ID to use for the static clone directory
#
#!/bin/bash
# Make a static clone the working copy of a Jenkins build
# to a public directory for browser testing.
# Usage:
# From within the Jenkins working copy directory.
#
# version 3 (2012-06-07)