Skip to content

Instantly share code, notes, and snippets.

View MarshallOfSound's full-sized avatar
:electron:
Building all the things...

Samuel Attard MarshallOfSound

:electron:
Building all the things...
View GitHub Profile
#include <node.h>
#include <nan.h>
#include <sstream>
#include <string>
#include <Windows.h>
#define _WIN32_WINNT 0x050
using namespace v8;
Local<Function> cb;
@MarshallOfSound
MarshallOfSound / Life Motto
Last active April 25, 2017 06:50
Javascript implemenation of Life Motto :)
var count = 0,
sad = function() {
if (++count === 1) {
return true;
}
return {
stop: function() {
console.log("I AM HAPPY!!!!");
}
};
@MarshallOfSound
MarshallOfSound / gist:b03ed5333dcb6337dfc2
Last active August 29, 2015 14:19
Square sum problem
def square_sum(n):
number = str(n);
i = 1;
while (i <= len(number)):
if (len(number) % i == 0):
start = 0;
sum = 0;
while (start + i <= len(number)):
sum += (int(number[start:(start+i)])) ** 2;
start += i;