Skip to content

Instantly share code, notes, and snippets.

Avatar

Christopher Chedeau vjeux

View GitHub Profile
View gist:797361
/*!
* jQuery JavaScript Library v1.4.4
* http://jquery.com/
*
* Copyright 2010, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Includes Sizzle.js
* http://sizzlejs.com/
View jquery-1.4.4-binary-ajax.js
/*!
* jQuery JavaScript Library v1.4.4
* http://jquery.com/
*
* Copyright 2010, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
* http://jquery.org/license
*
* Includes Sizzle.js
* http://sizzlejs.com/
@vjeux
vjeux / LICENSE.txt
Created May 22, 2011 — forked from WebReflection/LICENSE.txt
140byt.es -- Array Shuffle
View LICENSE.txt
Copyright (c) 2011 Christopher Chedeau, http://blog.vjeux.com/
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:
View gist:1253426
// Source: http://davidflanagan.com/Talks/jsconf11/BytesAndBlobs.html
// Load File
function loadBlob(path, callback) {
webkitRequestFileSystem( // Ask for filesystem
PERSISTENT, 50*1024*1024,
function(fs) { // When we get filesystem
fs.root.getFile( // Ask for a fs entry
path, {}, // With this name
function(entry) { // When we get entry
View gist:1274869
// Handle when the DOM is ready
ready: function( wait ) {
// Either a released hold or an DOMready/load event and not yet ready
if ( (wait === true && !--jQuery.readyWait) || (wait !== true && !jQuery.isReady) ) {
// Make sure body exists, at least, in case IE gets a little overzealous (ticket #5443).
if ( !document.body ) {
return setTimeout( jQuery.ready, 1 );
}
// Remember that the DOM is ready
View gist:1280750
/* Input */
function f1(i) {
console.log('f1');
if (i) {
console.log(1);
} else if (i > 2)
console.log(2);
else if (true) {
View gist:1314520
// Change
status = xhr.status;
responseHeaders = xhr.getAllResponseHeaders();
responses = {};
xml = xhr.responseXML;
// Construct response list
if ( xml && xml.documentElement /* #4958 */ ) {
responses.xml = xml;
View gist:1345916
while outer_condition()
while inner_condition()
[a, b] = pick2()
delta = swap a, b
if delta < 0 or Math.random() < Math.exp(-(delta + 1) / T)
cost += delta
else
swap a, b # revert
T *= C
@vjeux
vjeux / gist:1422736
Created Dec 2, 2011
Wikipedia Favicon
View gist:1422736
{ header: { reserved: 0, type: 0, imageCount: 1, padding: [ 0, 1, 0 ] },
images:
[ { width: 16,
height: 16,
paletteCount: 16,
reserved: 0,
colorPlanes: 1,
bitsPerPixel: 4,
size: 296,
offset: 22,
@vjeux
vjeux / LICENSE.txt
Created Dec 12, 2011 — forked from madrobby/LICENSE.txt
Functional array sorting
View LICENSE.txt
Copyright (c) 2011 Christopher Chedeau, http://blog.vjeux.com/
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions: