// jQuery
$(document).ready(function() {
// code
})The script below is triggered every day from my Mac. I use Hazel to move the tar.gz to an external hard disk once it's finished. This happens every day without me noticing. You can exclude folders if you want to. You probably want to exclude giant cache folders.
You should have a similar script.
At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)
Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.
| var http = require('http'); | |
| var server = http.createServer(function(req, res) { | |
| // console.log(req); // debug dump the request | |
| // If they pass in a basic auth credential it'll be in a header called "Authorization" (note NodeJS lowercases the names of headers in its request object) | |
| var auth = req.headers['authorization']; // auth is in base64(username:password) so we need to decode the base64 | |
| console.log("Authorization Header is: ", auth); |
| //lo sauer, 2011; lsauer.com | |
| /** | |
| * I saw this thread: http://stackoverflow.com/questions/840781/easiest-way-to-find-duplicate-values-in-a-javascript-array | |
| * The solutions above lacked the elegance that can be done a with map-reduce-like operations | |
| * Since this implementation works with native functions, the speed is in most circumstances faster | |
| * than any solution using scripted-logic | |
| * Additionally, I needed to quickly filter duplicate url-entries for: http://lsauer.github.com/chrome-session-restore/ | |
| */ | |
| //copy and paste: without error handling | |
| Array.prototype.unique = function(){return this.sort().filter( function(v,i,o){if(i>=0 && v!==o[i-1]) return v;});} |
| var lines = { | |
| B: 'Bakerloo', | |
| C: 'Central', | |
| D: 'District', | |
| H: 'Hammersmith & Circle', | |
| J: 'Jubilee', | |
| M: 'Metropolitan', | |
| N: 'Northern', | |
| P: 'Piccadilly', |
Standard practices say no non-root process gets to talk to the Internet on a port less than 1024. How, then, could I get Node talking on port 80 on EC2? (I wanted it to go as fast as possible and use the smallest possible share of my teeny tiny little micro-instance's resources, so proxying through nginx or Apache seemed suboptimal.)
Alter the port the script talks to from 8000 to 80:
}).listen(80);
| install PostgreSQL 9 in Mac OSX via Homebrew | |
| Mac OS X Snow Leopard | |
| System Version: Mac OS X 10.6.5 | |
| Kernel Version: Darwin 10.5.0 | |
| Install notes for PostgreSQL 9.0.1 install using Homebrew: | |
| sh-3.2# brew install postgresql |