This file contains 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
var array_a = [1,2,3]; | |
var copy_of_array_a = array_a.slice(0); |
This file contains 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
function ANSI_X923_pad(hex_str, blocksize) { | |
blocksize = blocksize || 512; // in bits | |
var bit_str_len = hex_str.length * 4; // in bits | |
var bit_str_len_hex = bit_str_len.toString(16); | |
// how many nibbles are left over? | |
var pad_nibbles = (((bit_str_len / blocksize) < 1) ? (blocksize - (bit_str_len_hex.length * 4)) - bit_str_len : (blocksize - (bit_str_len_hex.length * 4)) - (bit_str_len - blocksize)) / 4; | |
return hex_str + new Array(1 + pad_nibbles).join(0) + bit_str_len_hex; | |
} |
This file contains 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
// bookmarklet to introspect the source of current page | |
javascript:(function(d,h){h=d.documentElement.innerHTML;d.open();d.write('<pre>'+('<!DOCTYPE html><html>'+h+'</html>').replace(/[<>]/g,function(m){return{'<':'<','>':'>'}[m]})+'</pre>')})(document); |
This file contains 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
function openURL(url) { | |
var a = d.createElement('a'), d = document; | |
a.href = url; | |
a.dispatchEvent(d.createEvent('MouseEvents').initMouseEvent('click')); | |
} |
This file contains 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
<html> | |
<head> | |
<title>Overflow test</title> | |
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;"> | |
<style> | |
body { | |
padding: 0; | |
} | |
#scroller { | |
overflow-y: scroll; |
This file contains 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
/* | |
Bullet Proof window drag | |
This is the most performant window dragging code | |
I could come up with. All the example on | |
developer.appcelerator.com we laggy | |
Version 2: More contained version | |
*/ |
This file contains 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
/** | |
* demand.js | |
* @author: Rob Griffiths | |
* On demand javascript | |
* | |
* Usage: | |
* demand('alerter', 'alerter.js'); | |
* ... | |
* alerter('OMG!'); // script is only inserted now and executed | |
* |
This file contains 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
var fs = require('fs'); | |
function JPEG(filename) { | |
var image = this; | |
image.blob = null; | |
if (filename) { | |
image = JPEG.loadFromFile(filename); | |
} |
This file contains 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
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
Version 2, December 2004 | |
Copyright (C) 2011 Rob Griffiths http://bytespider.eu | |
Everyone is permitted to copy and distribute verbatim or modified | |
copies of this license document, and changing it is allowed as long | |
as the name is changed. | |
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
OlderNewer