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
// Modified from Node.JS documentation: http://nodejs.org/docs/v0.2.5/api.html#http-client-183 | |
var http = require('http'); | |
var server = http.createClient(8124, '127.0.0.1'); | |
var request = server.request('GET', '/', {'host': '127.0.0.1'}); | |
request.end(); | |
request.on('response', function (response) { | |
console.log('STATUS: ' + response.statusCode); | |
console.log('HEADERS: ' + JSON.stringify(response.headers)); | |
response.setEncoding('utf8'); |
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
<!doctype html> | |
<html lang="en"> | |
<head> | |
<title>Altering Metatags At Runtime</title> | |
<meta id="meta-test" name="Copyright" content="(C)2011 Some User" /> | |
</head> | |
<body> | |
<h1>Altering Metatags At Runtime</h1> | |
<p id="output">(Click "Check Metatag")</p> |
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
<script> | |
// Inspired by http://stackoverflow.com/questions/6293495/ | |
myTable = document.getElementsByTagName('table')[0]; | |
if (document.implementation.hasFeature('MutationEvents','2.0') | |
|| window.MutationEvent) { | |
myTable.addEventListener('DOMNodeInserted', function(e) { |
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:(function() { | |
if(!window.your_bookmarklet) { | |
var doc = document, | |
js = doc.createElement('script'); | |
js.type = 'text/javascript'; | |
js.src = 'loader.js'; | |
js.async = true; |
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
# wget --header='Accept-Encoding: gzip' -O root.bin.gz http://bellard.org/jslinux/root.bin | |
# gunzip root.bin.gz | |
# mkdir mnt | |
# mkdir files | |
# sudo mount -t ext2 -o loop root.bin mnt | |
# dd if=/dev/zero of=files/root.bin bs=1k count=4096 | |
# sudo mke2fs -m 0 -i 2000 files/root.bin | |
# mkdir mnt2 | |
# sudo mount -t ext2 -o loop files/root.bin mnt2 | |
# sudo cp -dpR mnt/* mnt2/ |
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/env node | |
var http = require('http'), | |
url = require('url'), | |
fs = require('fs'), | |
util = require('util'), | |
host = '127.0.0.1', | |
port = 8080, | |
useBAC = true, |
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
package JSONSimple; | |
use strict; | |
sub new { | |
my $class = shift; | |
my $self = {}; | |
bless($self, $class); | |
return $self; | |
} |
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
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> | |
<html> | |
<head> | |
<title> | |
MobileSafari Live Click Bug | |
</title> | |
<script src='http://code.jquery.com/jquery-git.js' type='text/javascript'></script> | |
<script src='http://media.lib.byu.edu/js/jquery/plugins/jquery.livequery-1.0.3.js' type='text/javascript'></script> | |
</head> | |
<body style='font-family: Helvetica;'> |
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
// ES6 | |
class Sub extends Super { | |
constructor() {/*constructor body */ } | |
method1 () {} | |
static method2 {} | |
} | |
// ES3/5 | |
function Sub() {/*constructor body */ } | |
Sub.__proto__ = Super; |
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/env bash | |
# A simple utility to read all .sql files in the current directory, create an | |
# in-memory database from them and start a sqlite3 shell | |
if [ -f mini.db ]; then | |
echo "found existing database, removing" | |
rm mini.db; | |
fi |
OlderNewer