This file contains hidden or 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() { | |
| var doc = document, | |
| htm = doc.documentElement, | |
| lct = null, // last click target | |
| nearest = function(elm, tag) { | |
| while (elm && elm.nodeName != tag) { | |
| elm = elm.parentNode; | |
| } | |
| return elm; | |
| }; |
This file contains hidden or 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
| // This might be useful for certain size-limited JS competitions, or not. #js | |
| function super_shrinkify( str ){ | |
| var prefix = 'eval("', | |
| suffix = '".replace(/./g,function(a){return String.fromCharCode((a=a.charCodeAt())/128,a%128)}))', | |
| out = prefix + str.replace( /(.)(.)/g, function(a,b,c){ | |
| return String.fromCharCode( 128 * b.charCodeAt() + c.charCodeAt() ); | |
| }) + suffix; | |
| console.log( 'overhead: ' + ( prefix.length + suffix.length ) + ' chars' ); |
This file contains hidden or 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 () { | |
| var forEach = [].forEach, | |
| regex = /^data-(.+)/, | |
| dashChar = /\-([a-z])/ig, | |
| el = document.createElement('div'), | |
| mutationSupported = false, | |
| match | |
| ; | |
| function detectMutation() { |
This file contains hidden or 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
| HDCP MASTER KEY (MIRROR THIS TEXT!) | |
| This is a forty times forty element matrix of fifty-six bit | |
| hexadecimal numbers. | |
| To generate a source key, take a forty-bit number that (in | |
| binary) consists of twenty ones and twenty zeroes; this is | |
| the source KSV. Add together those twenty rows of the matrix | |
| that correspond to the ones in the KSV (with the lowest bit | |
| in the KSV corresponding to the first row), taking all elements |
This file contains hidden or 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
| // So what I'm doing here seems cool, but I'm not sure exactly what it should be | |
| // called. Is this partial application? Currying? Something else? Vindaloo maybe? | |
| // | |
| // Either way, it's a pretty interesting pattern.. I wonder if it has any | |
| // real-world application. Probably not. | |
| // | |
| // Invoking the partially applied function will always return a function until | |
| // ALL arguments are satisfied, at which point the original function is invoked, | |
| // returning its result. This means that all function arguments are required, | |
| // which also allows the function to be called either like foo( 1, 2, 3 ) or |
This file contains hidden or 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 () { | |
| var forEach = [].forEach, | |
| regex = /^data-(.+)/, | |
| dashChar = /\-([a-z])/ig, | |
| el = document.createElement('div'), | |
| mutationSupported = false, | |
| match | |
| ; | |
| function detectMutation() { |
This file contains hidden or 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
| /* | |
| * from WebReflection | |
| * http://webreflection.blogspot.com/2007/06/simple-settimeout-setinterval-extra.html | |
| * | |
| */ | |
| (function (f) { | |
| global.setTimeout = f(global.setTimeout); | |
| global.setInterval = f(global.setInterval); | |
| })(function (f) { | |
| return function (c, t) { |
This file contains hidden or 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
| /** | |
| * -------------------------------------------------------------------- | |
| * jQuery-Plugin "pngFix" | |
| * Version: 1.2, 09.03.2009 | |
| * by Andreas Eberhard, [email protected] | |
| * http://jquery.andreaseberhard.de/ | |
| * | |
| * Copyright (c) 2007 Andreas Eberhard | |
| * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php) | |
| * |
This file contains hidden or 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
| /** | |
| * -------------------------------------------------------------------- | |
| * jQuery-Plugin "pngFix" | |
| * Version: 1.2, 09.03.2009 | |
| * by Andreas Eberhard, [email protected] | |
| * http://jquery.andreaseberhard.de/ | |
| * | |
| * Copyright (c) 2007 Andreas Eberhard | |
| * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php) | |
| * |
This file contains hidden or 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
| #!/bin/bash | |
| #version 0.1 | |
| cd ~/browser-installs/profile/ | |
| #Opera tab count | |
| if [ -e "sessions/autosave.win" ]; then | |
| tab_opera_c=`egrep 'window count=([0-9]*)' sessions/autosave.win | awk '{split($2, s, "="); print s[2]}'` | |
| window_opera_c=`grep -c 'type=0' sessions/autosave.win` | |
| actual_opera_c=$(($tab_opera_c - $window_opera_c)) | |
| echo "- "$actual_opera_c" tabs in "$window_opera_c" windows" |