Skip to content

Instantly share code, notes, and snippets.

View Nomon's full-sized avatar

Matti Savolainen Nomon

  • Helsinki, Finland
View GitHub Profile
@Nomon
Nomon / keybase.md
Created June 29, 2017 13:44
keybase.md

Keybase proof

I hereby claim:

  • I am nomon on github.
  • I am nomon (https://keybase.io/nomon) on keybase.
  • I have a public key ASAOflpYI08Mt_VuKEtGelvYbxa3lC9ZfERNOODF9BzwGQo

To claim this, I am signing this object:

var jugglingdb = require('jugglingdb');
var Schema = jugglingdb.Schema;
var schema = exports.schema = new Schema('redis', {
port: 6379,
host: "localhost"
});
var User = schema.define('User',{
field1:String
var repl = require('repl');
var jugglingdb = require('jugglingdb');
var schema = require('./lib/model/schema').schema;
var Model = require('./lib/model');
var util = require('util');
var User = Model.User.User;
var Channel = Model.Channel.Channel;
var Network = Model.Network.Network;
var Server = Model.Server.Server;
Photo.static({
recent: function(days, callback){
days = days || 1
var query = this.find({
date: {
$gte: Date.now() - 1000 * 60 * 60 * 24 * days
}
}).sort(['date',-1])
query.exec(callback)
}
var getCurrencyByGeoCode = function(country) {
if(country == "US") {
return "USD";
} else if(country == "GB") {
return "GBP";
} else if(country == "JP") {
return "JPY";
} else if(country == "CA") {
return "CAD";
} else if(country == "AU" || country == "NZ") {
@Nomon
Nomon / ahex.js
Created June 14, 2011 06:09
ahex
var id = "4df67d6dcc19519d0f098bd6"
var ahex = id.split('').map(function(a) {
// isNumber
if((a - 0) == a && a.length > 0) {
// g because 0 would collide with hex f. 0->"g",1->"h","a"->"a" etc
return String.fromCharCode("g".charCodeAt(0)+Number(a));
}
return a;
}).join('');
@Nomon
Nomon / t.js
Created April 27, 2011 16:39
kek
ar t = require('./test');
// a returns print function "b" increment function
var a = t("a");
var b = t("b");
a();
b();
setTimeout(a,100);
setTimeout(a,200);
setTimeout(b,150);
$ node --version
v0.2.5
$ node file.js
index.js
file.js
----
$ node --version
v0.3.7-pre
$ node file.js
require.extensions['.js'] = function(module,filename) {
var content;
content = require('fs').readFileSync(filename, 'utf8');
return module._compile(content.replace(/^ *\/\/debug: */gm, ''), filename);
}