Skip to content

Instantly share code, notes, and snippets.

View allentong's full-sized avatar

Allen Tong allentong

View GitHub Profile
@allentong
allentong / Datepicker HackFix for Internet Explorer
Created May 22, 2012 15:27
Internet Explorer jQuery UI Datepicker access the link on IE via the href tag. This fix removes the href tag attribute on selection. Tested in jQuery UI 1.8.18 and below
$(Selector).datepicker({
onSelect: function () {
$(".ui-datepicker a").removeAttr("href"); // Hack to fix Datepicker in IE
}
});
@allentong
allentong / console.log fallback
Created May 30, 2012 16:10
Console.Log Fallback for Javascript
var alertFallback = false;
if (typeof console === "undefined" || typeof console.log === "undefined") {
console = {};
if (alertFallback) {
console.log = function (msg) {
alert(msg);
};
} else {
console.log = function () { };
}
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);
@allentong
allentong / gist:caa60a9fcee45683cc61eb9af8c91bdc
Last active July 8, 2016 18:37
Firefox Back Button Reload Fix
$(window).bind("pageshow", function(event) {
if (event.originalEvent.persisted) {
location.reload();
}
});
atom-text-editor::shadow {
.wrap-guide {
visibility: hidden;
}
}
@allentong
allentong / cloudSettings
Last active January 12, 2017 19:16
Visual Studio Code Sync Settings GIST
{"lastUpload":"2017-01-12T19:16:43.887Z"}