Skip to content

Instantly share code, notes, and snippets.

View pfleidi's full-sized avatar

Sven Pfleiderer pfleidi

View GitHub Profile
@pfleidi
pfleidi / gridstoretest.js
Created December 19, 2010 22:41
Example using the mongodb-native module and step to write to mongodb gridfs
var Db = require('mongodb').Db,
Connection = require('mongodb').Connection,
Server = require('mongodb').Server,
GridStore = require('mongodb').GridStore,
Step = require('step'),
Sys = require('sys'),
Fs = require('fs');
var database;
http://julien51.github.com/socket-sub/maps
http://saber-tooth-moose-lion.no.de/
http://rallarpojken.no.de/
http://rumpetroll.com/
# init
git init
# add files
git add .
# commit files
git commit -m 'add file'
# create branch and check it out
#!/usr/bin/env ruby
require 'rubygems'
require 'rexml/document'
require 'trollop'
@options = Trollop::options do
version "parseitems.rb 0.1 (c) 2010 Sven Pfleiderer"
banner <<-EOS
This is a simple, script which takes an xml file with items and generates a wiki table with the given content
trait Similarity {
def isSimilar(x: Any): Boolean
def isNotSimilar(x: Any): Boolean = !isSimilar(x)
}
class TestClass(val member: Boolean) extends Similarity {
// method implementation with cast
def isSimilar(x: Any) = { x.asInstanceOf[TestClass].member == member }
}