Skip to content

Instantly share code, notes, and snippets.

View hellerve's full-sized avatar

Veit Heller hellerve

View GitHub Profile
@hellerve
hellerve / gist:59a7d3c4d1a7054ab7fb
Created July 16, 2015 16:29
Private methods in JS
var myObj = (function() {
function myObj(something) {
this.something = something;
}
function privateMethod() {
console.log("private method called");
}
myObj.prototype.publicMethod = function() {
@hellerve
hellerve / gist:dd77db4bccfed583f102
Created February 5, 2015 14:40
Obscure C++ syntax
#include <stdio.h>
int main() <%
int x <:3] = {1, 2, 3%>;
printf("%d, %d, %d\n", x[0:>, x<:1], x<:2:>);
return 0;
}
@hellerve
hellerve / guess_the_number.bingo
Created January 8, 2015 12:26
An example bingo program
secret_number gets between: 1 10
3 times
write: Choose a number from 1 to 10.
my_number gets ask: >
if my_number is @secret_number
write: You win! The number was @secret_number.
quit
else