This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* XHR Monitor | |
* | |
* @author Livingston Samuel | |
* @copyright (c) 2010 | |
* | |
* @browsers FF 3.6.3 | |
*/ | |
;(function (win, doc, XHR) { | |
var currentEvent = '', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//detect Internet Explorer and version number through injected conditional comments (no UA detect, no need for cond. compilation / jscript check) | |
//version arg is for IE version (optional) | |
//comparison arg supports 'lte', 'gte', etc (optional) | |
var isIE = (function(doc, undefined){ | |
var cache = {}, | |
elem; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* Cleanup Wordpress Header & use Google Hosted jQuery */ | |
function cleanUp() { | |
function restatement_scripts_unversion($src) { | |
if( strpos($src,'ajax.googleapis.com') ) | |
$src=remove_query_arg('ver', $src); | |
return $src; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Optimized Script for loading User Voice Script | |
* Based on idea by kangax @ http://gist.github.com/381634 | |
*/ | |
var uservoiceOptions = { | |
/* ... */ | |
}; | |
//Using `self` rather than `window` to prevent cross-domain issues when used in iframe | |
self.onload = (function (w, d, t) { | |
var _loadUserVoice = function () { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- HTML5 Geolocation with Fallback to Google Ajax API | |
-- http://marcgrabanski.com/article/html5-geolocation-fallback-google-ajax-api | |
--> | |
<script src="http://www.google.com/jsapi?key=YOUR_API_KEY" type='text/javascript'></script> | |
<script type='text/javascript'> | |
var myLocation; // global variable to store lat/lng | |
if (navigator && navigator.geolocation) { | |
// HTML5 GeoLocation | |
function getLocation(position) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Sieve of Eratosthenes 1.1 | |
* Author: Livingston Samuel, [email protected] | |
* Date: 24th April 2010 | |
* Description: the Sieve of Eratosthenes (Greek: κόσκινον Ἐρατοσθένους) is a simple, ancient algorithm for finding all prime numbers up to a specified integer. | |
* | |
* http://en.wikipedia.org/wiki/Sieve_of_Eratosthenes | |
*/ | |
(function () { | |
var compactArray = function(arr) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* 1. Life, the Universe, and Everything | |
Problem code: TEST | |
Your program is to use the brute-force approach in order to find the Answer to Life, the Universe, and Everything. | |
More precisely... rewrite small numbers from input to output. Stop processing input after reading in the number 42. | |
All numbers at input are integers of one or two digits. | |
Example: | |
Input: 1 2 88 42 99 | |
Output: 1 2 88 | |
*/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Optimized Google Analytics Tracker code | |
// http://mathiasbynens.be/notes/async-analytics-snippet | |
var _gaq = [['_setAccount', 'UA-XXXXX-X'], ['_trackPageview']]; | |
// replace XXXXX-X with your tracking id | |
(function(d, t) { | |
var s = d.getElementsByTagName(t)[0], | |
g = d.createElement(t); | |
g.async = !0; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Collection of DOM Helper Methods | |
* Livingston Samuel | |
*/ | |
var DOM = {}; | |
/* Get Next Element node Sibling - Equivalent of nextElementSibling */ | |
DOM.next = function (elem) { | |
var sibling = elem.nextSibling; |