Skip to content

Instantly share code, notes, and snippets.

View danielepolencic's full-sized avatar
💭
☸️

Daniele Polencic danielepolencic

💭
☸️
View GitHub Profile
module.exports = Foo
function Foo () {}
Foo.prototype.one = function (l) {
this.two(l);
};
Foo.prototype.two = function (l) {
if (l % 2) {
function Stream () {
this.fns = [];
}
Stream.prototype.push = function (element) {
var accumulator = this.fns[0](element);
for (var i = 1, len = this.fns.length; i < len; i++) {
if (accumulator) { accumulator = this.fns[i](accumulator); } else { break; }
}
};
function myClass(){}
myClass.prototype = {
myName: "some name" ,
settings: {name: 'random'}
};
m1 = new myClass();
m2 = new myClass();
m1.myName // some name

Please read the new and updated version.

Sendy

Sendy is a self hosted email newsletter application that lets you send trackable emails via Amazon Simple Email Service (SES).

Heroku

You can deploy Sendy on Heroku using the following instructions (I assume you've already installed the heroku toolbelt).

// The following piece of code produce steady usage of memory
// when one of the first two console.log are uncommented. However,
// when the last console.log is the only console.log uncommented,
// memory usage grows indefinitely.
setInterval( function(){
var util = require('util')
// Uncomment one of the following lines:
// console.log('Ding! ', 'Dong' ) // 16.9MB
// console.log('Ding! ', util.inspect('Dong') ) // 17.1MB
@danielepolencic
danielepolencic / robot.js
Created December 10, 2012 20:48 — forked from acelan/robot.js
Frextank
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
var self = this;
self.robot = robot;
self.members = {};
self.enemies = {};
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
// {
// robot: {
// // INFORMATION ON THE CURRENT GAME
// id, // Id from your robot
// angle, // Current angle from your robot in degrees
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
// {
// robot: {
// // INFORMATION ON THE CURRENT GAME
// id, // Id from your robot
// angle, // Current angle from your robot in degrees
@danielepolencic
danielepolencic / robot.js
Created December 10, 2012 14:17
dantest
//FightCode can only understand your robot
//if its class is called Robot
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
var robot = ev.robot;
robot.ahead(100);
var Robot = function(robot) {
};
Robot.prototype.onIdle = function(ev) {
// {
// robot: {
// // INFORMATION ON THE CURRENT GAME
// id, // Id from your robot
// angle, // Current angle from your robot in degrees