Skip to content

Instantly share code, notes, and snippets.

View hackervera's full-sized avatar
😻

Veronika Tyler hackervera

😻
View GitHub Profile
@hackervera
hackervera / gist:502937
Created August 1, 2010 04:14 — forked from donpdonp/gist:493101
issac bot ruby
require 'json'
require 'isaac'
configure do |c|
c.nick = "icecondor"
c.server = "irc.freenode.net"
c.port = 6667
end
on :connect do
@hackervera
hackervera / beer
Created August 1, 2010 10:08
Hipster javascript
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;
<script>
var foo = new Object();
foo.cool = prompt('yo');
var dude = foo.cool;
console.log(dude);
</script>
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 :)
@hackervera
hackervera / getjson.rb
Created August 5, 2010 07:42
json url formatter
require 'rubygems'
require 'json'
require 'ap'
url = ARGV[0]
puts url
res = %x[curl "#{url}"]
puts JSON.pretty_generate(JSON.parse(res))
@hackervera
hackervera / gist:526179
Created August 16, 2010 00:52
geo function
function(doc) {
if (doc.loc) {
emit({
type: "Point",
coordinates: [doc.loc[0], doc.loc[1]]
}, [doc._id, doc.loc]);
}
else {
emit({
type: "Point",
@hackervera
hackervera / gist:543454
Created August 22, 2010 07:01
build-couchdb geocouch error
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.
@hackervera
hackervera / gist:543455
Created August 22, 2010 07:04
build-couchdb geocouch
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)
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;
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();
});