This file contains hidden or 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
/* | |
* Copyright (c) 2010 Tobias Schneider | |
* This script is freely distributable under the terms of the MIT license. | |
*/ | |
(function(){ | |
var UPC_SET = { | |
"3211": '0', | |
"2221": '1', | |
"2122": '2', |
This file contains hidden or 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 sys = require("sys") | |
var http = require("http"); | |
var twitter = http.createClient(80, "search.twitter.com"); | |
var count = 10 | |
for (var i = 1; i <= count; i++) { | |
var request = twitter.request("GET", "/search.json?q=crockfordfact+OR+crockfordfacts&rpp=100&page=" + i, {"host": "search.twitter.com"}); | |
request.addListener('response', function(response) { |
This file contains hidden or 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
if (!navigator.geolocation) { | |
navigator.geolocation = (function (window) { | |
function getCurrentPosition(callback) { | |
// NOTE: for some reason, chaging the url is *allowed* with this service. Useful, but random | |
// source: http://www.maxmind.com/app/javascript_city | |
// The source is open source, as per: http://www.maxmind.com/app/api, but doesn't discuss specific license use. Hopefully it's just free to use - yay internet! | |
var geourl = 'http://j.maxmind.com/app/geoip.js_' + Math.random(), | |
iframe = document.createElement('iframe'), | |
doc, win; |
This file contains hidden or 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
/* | |
evaluates as a block — "{" and "}" — containing one labeled statement — `a:"a"`. | |
labeled statement, in its turn, evaluates to "a". | |
*/ | |
{a:"a"} | |
/* | |
evaluates as an expression, where "(" and ")" are grouping operator and "{" and "}" constitute an object literal. | |
evaluates to this object value. |