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(exports, undefined){ | |
/** | |
* obj2url() takes an object as argument and generates | |
* a querystring. pretty much like $.param() but without $ | |
* | |
* @param Object json-object | |
* @param String current querystring-part | |
* @return String encoded querystring | |
*/ | |
var obj2url = exports.obj2url = function(obj, temp) { |
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" manifest="cache.manifest"> | |
<head> | |
<meta charset="utf-8" /> | |
<title>contenteditable and window.getSelection()</title> | |
<style type="text/css"> | |
body {background:black; color:white;} | |
div {margin:10px;} | |
#editable {background:white; color:black;} | |
#editable p {border:1px dashed gray;} |
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(exports, undefined) { | |
/** | |
* create/access objects with a key-string | |
* | |
* with eval(): with stringObj(): | |
* ----------------------------- ------------------------------ | |
* var keyString = 'json.data' var keyString = 'json.data' | |
* , value = 'a value'; , value = 'a value'; | |
* eval(keyString+' = '+value); stringObj(keyString, value); | |
* alert(eval(keyString)); alert(stringObj(keyString)); |
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> | |
<!-- Helpful things to keep in your <head/> | |
// Brian Blakely, 360i | |
// http://twitter.com/brianblakely/ | |
--> | |
<head> | |
<!-- According to Heather Champ, former community manager at flickr, | |
you should not allow search engines to index your "Contact Us" |
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/local/bin/node | |
var sys = require('sys'), | |
http = require('http'), | |
querystring = require('querystring'), | |
base64 = require('./lib/base64'), | |
Buffer = require('buffer').Buffer, | |
Irc = require('./vendor/IRC/lib/irc'); | |
var twitter_auth = { user: "<YOUR_TWITTER_USERNAME>", pass: "<YOUR_TWITTER_PASSWORD>"}; |
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
# | |
# node ---------------> ~/.nvm/<node-version>/bin/node | |
# node-libraries -----> ~/.node_libraries | |
# node-binaries ------> ~/.node_binaries | |
# | |
aptitude install g++ curl libssl-dev apache2-utils make | |
git clone git://github.com/creationix/nvm.git ~/.nvm | |
vi ~/.bashrc | |
export PATH=$PATH:~/.node_binaries | |
NVM_DIR=$HOME/.nvm |
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
app.get(/^\/foo\/(.+)/, function(req, res) { | |
var encoding = (/[.png]+$/.test(req.params[0])) ? 'binary' : 'utf-8'; | |
var path = '/foo/'+req.params[0]; | |
fs.readFile(path, encoding, function(err, data) { | |
if (err) { | |
throw err; | |
} else { | |
res.contentType(req.params[0]); | |
res.send(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
/*! | |
* Table.js | |
* Copyright(c) 2010 TJ Holowaychuk <[email protected]> | |
* MIT Licensed | |
*/ | |
/** | |
* http://github.com/Marak/table.js/blob/master/lib/table.js | |
*/ |
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> | |
<head> | |
<title></title> | |
<style> | |
body {background:black; color:white;} | |
</style> | |
<script src="http://code.jquery.com/jquery.min.js" type="text/javascript"></script> | |
<link id="bespin_base" href="BespinEmbedded-0.9a2/prebuilt"/> | |
<script src="BespinEmbedded-0.9a2/prebuilt/BespinEmbedded.js"></script> |
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
body { | |
font: Arial; | |
/* | |
font: 18px/27px 'YanoneKaffeesatzRegular', Arial, sans-serif; | |
font-family:"Myriad Pro",georgia, helvetica, arial, sans serif; | |
*/ | |
font-size:larger; | |
background:black; color:white; margin-left:300px; width:500px; padding:20px} | |
a {color:yellow; background:black;} | |
a:hover {color:black; background:yellow;} |
OlderNewer