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
<!-- 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
/* 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
<?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
//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
/* 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
/* | |
* Copyright (c) 2010 Tobias Schneider | |
* This script is freely distributable under the terms of the MIT license. | |
*/ | |
(function(){ | |
var UPC_SET = { | |
"3211": '0', | |
"2221": '1', | |
"2122": '2', |
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
/* Cross-browser Compatible Event Bind Method | |
* | |
* @arguments element reference, event name, function/function reference | |
* | |
*/ | |
var bind = (function (win) { | |
if (win.addEventListener) { | |
return function (elem, evt, fn, phase) { | |
elem.addEventListener(evt, fn, phase || false); |
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
/* tracer.js - A tracer utility in 2kb | |
* | |
* @author Angus Croll | |
* http://javascriptweblog.wordpress.com/2010/06/01/a-tracer-utility-in-2kb/ | |
*/ | |
String.prototype.times = function(count) { | |
return count < 1 ? '' : new Array(count + 1).join(this); | |
} |
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
Mozilla/5.0 (iPad; U; CPU OS 3_2 like Mac OS X; en-us) AppleWebKit/531.21.10 (KHTML, like Gecko) Version/4.0.4 Mobile/7B334b Safari/531.21.10 |