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
require 'json' | |
require 'isaac' | |
configure do |c| | |
c.nick = "icecondor" | |
c.server = "irc.freenode.net" | |
c.port = 6667 | |
end | |
on :connect do |
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
require('./MooTools').apply(GLOBAL); | |
var sys = require('sys'); | |
var Human = new Class({ | |
eat: function() { this.energy++; }, | |
drink: function(target){ target.open(); } | |
}); | |
var Beer = new Class({ | |
initialize: function(brewer, age){ | |
this.brewer = brewer; | |
this.age = age; |
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> | |
var foo = new Object(); | |
foo.cool = prompt('yo'); | |
var dude = foo.cool; | |
console.log(dude); | |
</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
require "rubygems" | |
require "superfeedr" | |
## You can have all the XMPP logging by changing the Skates log level | |
Skates.logger.level = Log4r::DEBUG | |
## | |
# Don't ever forget that all this is ASYNCHRONOUS... | |
# If you don't run EM in your program, then it will started for... however, EM.run begin a blocking call, you shoudl probably run it into a specific Thread to keep the rest of your app running :) |
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
require 'rubygems' | |
require 'json' | |
require 'ap' | |
url = ARGV[0] | |
puts url | |
res = %x[curl "#{url}"] | |
puts JSON.pretty_generate(JSON.parse(res)) |
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(doc) { | |
if (doc.loc) { | |
emit({ | |
type: "Point", | |
coordinates: [doc.loc[0], doc.loc[1]] | |
}, [doc._id, doc.loc]); | |
} | |
else { | |
emit({ | |
type: "Point", |
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
git checkout geocouch | |
Already on 'geocouch' | |
git reset --hard | |
git clean -f -d | |
git ls-files --others -i --exclude-standard | xargs rm -v || true | |
./bootstrap | |
env LDFLAGS='-R/root/build-couchdb/build/lib -L/root/build-couchdb/build/lib' CFLAGS='-I/root/build-couchdb/build/include/js' /root/build-couchdb/git-build/git%3A%2F%2Fgithub.com%2Fvmx%2Fcouchdb/configure --prefix=/root/build-couchdb/build --with-erlang=/root/build-couchdb/build/lib/erlang/usr/include | |
configure: WARNING: jsapi.h: accepted by the compiler, rejected by the preprocessor! | |
configure: WARNING: jsapi.h: proceeding with the compiler's result | |
configure: WARNING: You will be unable to regenerate any man pages. |
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
git checkout geocouch | |
(in /root/build-couchdb) | |
** Invoke default (first_time) | |
** Invoke couchdb:clean_install (first_time) | |
** Invoke couchdb:build (first_time) | |
** Invoke erlang:build (first_time) | |
** Invoke known_distro (first_time) | |
** Invoke known_mac (first_time) | |
** Execute known_mac | |
** Invoke known_ubuntu (first_time) |
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 getGeo(address){ | |
url = "http://geocoding.cloudmade.com/BC9A493B41014CAABB98F0471D759707/geocoding/v2/find.js?around="+escape(address)+"&return_geometry=true&object_type=area"; | |
var res; | |
http.perform(url,"GET",function(response){ | |
res = response; | |
}); | |
console.log(sys.inspect(res)); | |
return res; | |
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
twttr.anywhere.config({ callbackURL: "http://5.7.0.88:5984/craigslist/_design/craigslist/test.html" }); | |
twttr.anywhere(function (T) { | |
T.currentUser.homeTimeline(function(tweets){ | |
console.log(tweets); | |
tweets = tweets.array.reverse(); | |
$.each(tweets,function(){ | |
console.log(this); | |
$("#twitter").prepend("@"+this.user.screenName+" "+this.text+" "+this.id+"<br>"); | |
T.hovercards(); | |
}); |