Skip to content

Instantly share code, notes, and snippets.

View Fordi's full-sized avatar

Bryan Elliott Fordi

View GitHub Profile
@Fordi
Fordi / text-clock.html
Created August 11, 2011 12:06
Text-based clock
<!DOCTYPE HTML>
<html lang="en-US">
<head>
<meta charset="UTF-8">
<title></title>
<style>
.clock {
font: 48pt Consolas;
margin: 0 auto;
width: 556pt;
@Fordi
Fordi / ShortcutIcon.js
Created July 19, 2011 19:29
Shortcut icon manager
jQuery.icon = (function ($) {
var types = {
ico: 'image/x-icon',
gif: 'image/gif',
png: 'image/png',
jpg: 'image/jpeg',
jpeg: 'image/jpeg'
},
_icon,
_stack=[],
@Fordi
Fordi / PHP's str_split for Javascript
Created July 1, 2011 23:55
Crock32: The Base32 implementation outlined by Douglas Crockford
Javascript str_split:
String.prototype.strSplit = function (n) {
return this.match(new RegExp('.{1,'+(n||1)+'}', 'g'));
}
@Fordi
Fordi / jquery.ajaxcancel.js
Created June 30, 2011 16:03
Function for killing all running ajax requests in jQuery
(function ($) {
var _ajax = $.ajax,
xhrQueue = [];
$.ajax = function () {
var ret;
xhrQueue.push(ret=_ajax.apply(this, arguments));
return ret;
};
$.ajaxCancel = function () {
while (xhrQueue.length>0) xhrQueue.pop().abort();