Skip to content

Instantly share code, notes, and snippets.

View fearphage's full-sized avatar
⌨️
Cache rules everything around me.

Phred Lane fearphage

⌨️
Cache rules everything around me.
View GitHub Profile
javascript:alert([].map.call('"iuuq;00uxjuufs/dpn0ipnf@tubuvt>Ahpphmfofyvt&31Svo-&31svo-&31bt&31gbtu&31bt&31zpv&31dbo"&31Zpv&31dbo(u&31dbudi&31nf-&31J(n&31uif&31Hjohfscsfbe&31Boespje"', function(c) { return String.fromCharCode(c.charCodeAt()-1); }).join(''))
/*
* prettified
*
* * * * * * *
javascript:alert(
[].map.call('"iuuq;00uxjuufs/dpn0ipnf@tubuvt>Ahpphmfofyvt&31Svo-&31svo-&31bt&31gbtu&31bt&31zpv&31dbo"&31Zpv&31dbo(u&31dbudi&31nf-&31J(n&31uif&31Hjohfscsfbe&31Boespje"'
,function(c) {
@fearphage
fearphage / gist:737019
Created December 11, 2010 00:16
File copy with streaming API
// Node.js example from the forthcoming 6th edition of JavaScript: The Definitive Guide
// Written by David Flanagan.
// File copy with streaming API.
// Pass a callback if you want to know when it is done
// Note that no error handling is even attempted here...
function fileCopy(filename1, filename2, done) {
var input = fs.createReadStream(filename1); // Input stream
var output = fs.createWriteStream(filename2); // Output stream
var sys = require("sys"),
fs = require("fs");
function processImageDir(path, outFilename, cb) {
fs.readdir(path, function(err, files) {
fs.writeFile(__dirname + '/' + outFilename, JSON.stringify({
images: files.filter(function(name) { return /(?:png|jpe?g|gif)$/i.test(name); })
}), function(err) {
if (err) throw err;
cb && cb("Sweet.");
JavaScript - file://localhost/C:/external.source/hg/dragonfly-stp-1-redesign/src/client-en.xml?debug
Unknown thread
Uncaught exception: TypeError: Function.prototype.apply: argArray is not an array-like object
Error thrown at line 784, column 2 in <anonymous function: Array.prototype.extend>(list) in file://localhost/C:/external.source/hg/dragonfly-stp-1-redesign/src/scripts/dom.js:
this.push.apply(this, list);
called from line 64, column 8 in <anonymous function: _friendly_print_chunked_cb>(list, response) in file://localhost/C:/external.source/hg/dragonfly-stp-1-redesign/src/repl/friendlyprinter.js:
list.extend(JSON.parse(msg[VALUE]));
called from line 54, column 4 in <anonymous function: _friendly_print_chunked_cb>(obj_list, rt_id, obj_ids, fallback, queue) in file://localhost/C:/external.source/hg/dragonfly-stp-1-redesign/src/repl/friendlyprinter.js:
var ret = queue.reduce(function(list, response)
called via Function.prototype.apply() from unknown location in <anonymous function: Function.prot
function initFixComments() {
function jumpToPage(url, pages, posts, e) {
var page, link = e.target, tf = true;
link.addEventListener('click'
,function(e) {
e.stopPropagation();
link.removeEventListener('click', arguments.callee, tf);
}
,tf
);
$ git clone github:lenary/guides.git
Cloning into guides...
remote: Counting objects: 255, done.
remote: Compressing objects: 100% (216/216), done.
remote: Total 255 (delta 111), reused 163 (delta 35)
Receiving objects: 100% (255/255), 1.49 MiB | 564 KiB/s, done.
Resolving deltas: 100% (111/111), done.
$ cd guides
$ git remote -v
@fearphage
fearphage / async_defer_script.js
Created March 22, 2011 14:18 — forked from edvakf/defer_async_script.js
async/defer support for Opera
// ==UserScript==
// @name defer/async for Opera
// @namespace http://d.hatena.ne.jp/edvakf/
// @license Public Domain
// ==/UserScript==
(function(window, document, opera) {
function load_script(script, attr) {
return function() {
var script2 = script.cloneNode(true);
@fearphage
fearphage / gist:887921
Created March 26, 2011 01:03
jquery#setNative
(function($) {
$.fn.setNative = function(property, value) {
return this.each(function() {
return this[property] = value;
});
};
})(jQuery);
<!DOCTYPE html>
<html>
<head>