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
// Javascript Arrays already have: | |
// Array.indexOf | |
// Array.lastIndexOf | |
// Array.every | |
// Array.filter | |
// Array.forEach | |
// Array.map | |
// Array.some | |
Array.prototype.remove = function (from, to) { |
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
" Change tabs to 2 spaces | |
:retab 2 | |
" Wrap the margin at 80 chars | |
:set wrapmargin=80 | |
" Show non-printable characters in Vim | |
:set list | |
" Interactive search and replace |
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
// Usage: | |
// var file = fopen("/tmp/firefuck.txt"); | |
// file.writeString("Hello, sir. How are you?\n"); | |
// file.close(); | |
var fopen = function (path) { | |
try { | |
var file = Components.classes["@mozilla.org/file/local;1"]. | |
createInstance(Components.interfaces.nsILocalFile); | |
file.initWithPath(path); | |
var stream = Components.classes["@mozilla.org/network/file-output-stream;1"]. |
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
// our particular spider | |
var spider = new Spider(); | |
spider.grabber = function ($) { | |
var urls = []; | |
$('.post-footer > a:nth-child(2)').each(function (i, node) { | |
urls.push(node.href); | |
}); | |
var next_page_button = $('.next_page'); | |
var on_last_page = next_page_button.hasClass('disabled'); | |
var data = { |
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
// ==UserScript== | |
// @name Eensy Weensy | |
// @namespace example.com | |
// @include http://borderstylo.com/posts* | |
// ==/UserScript== |
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 css64Encode = function (string) { | |
return $.base64Encode(string). | |
replace(/\//g, '--_'). | |
replace(/\+/g, '-_'). | |
replace(/\=/g, '_'); | |
}; | |
var css64Decode = function (string) { | |
return $.base64Decode(string. | |
replace(/--_/g, '/'). |
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
/\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.])(?:[^\s()<>]+|\([^\s()<>]+\))+(?:\([^\s()<>]+\)|[^`!()\[\]{};:'".,<>?«»“”‘’\s]))/img |
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
# load a file foo.pez into the repl | |
-> "foo.pez" load | |
0 | |
# concatenate two strings | |
-> "hello" "world" s+ | |
Stack: 32395168 | |
-> puts | |
helloworld |
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 express = require('express'), | |
request = require('request'), | |
BufferList = require('bufferlist').BufferList, | |
sys = require('sys'); | |
var app = express.createServer( | |
express.logger(), | |
express.bodyDecoder() | |
); |
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
#!/usr/bin/perl | |
use strict; | |
use warnings; | |
use LWP::UserAgent; | |
use Math::BaseArith; | |
my $browser = LWP::UserAgent->new; | |
sub get { |
OlderNewer