Skip to content

Instantly share code, notes, and snippets.

Robin Herbots RobinHerbots

  • Belgium
View GitHub Profile
ChaseFlorell / uriSchemeWithHyperlinkFallback.js
Last active Apr 23, 2019
Ever want to launch a mobile app from within the browser, but ensure that the browser still redirects the user to the link if the app isn't installed? This took some fiddling around, but when the "ah ha" moment hit, the solution is really quite simple.
View uriSchemeWithHyperlinkFallback.js
// tries to execute the uri:scheme
function uriSchemeWithHyperlinkFallback(uri, href) {
// set up a timer and start it
var start = new Date().getTime(),
// attempt to redirect to the uri:scheme
// the lovely thing about javascript is that it's single threadded.
// if this WORKS, it'll stutter for a split second, causing the timer to be off
pithyless / gist:1547408
Created Jan 1, 2012
jQuery set Headers for $.ajax
View gist:1547408
// jQuery Headers support for $.ajax
beforeSend: function(xhrObj){
type: "POST",
url: "/article",
processData: false,
db / jquery.ajax.progress.js
Created May 11, 2011
add XHR2 progress events to jQuery.ajax
View jquery.ajax.progress.js
(function addXhrProgressEvent($) {
var originalXhr = $.ajaxSettings.xhr;
progress: function() { console.log("standard progress callback"); },
xhr: function() {
var req = originalXhr(), that = this;
if (req) {
if (typeof req.addEventListener == "function") {
req.addEventListener("progress", function(evt) {
chicagoworks / jQuery.stringify.js
Created Dec 24, 2010
jQuery.stringify() utility
View jQuery.stringify.js
* converted stringify() to jQuery plugin.
* serializes a simple object to a JSON formatted string.
* Note: stringify() is different from jQuery.serialize() which URLEncodes form elements
* Added a fix to skip over Object.prototype members added by the prototype.js library
* jQuery.ajax({
You can’t perform that action at this time.