Skip to content

Instantly share code, notes, and snippets.

View madbence's full-sized avatar
🙈
watching cat videos on the internet

Bence Dányi madbence

🙈
watching cat videos on the internet
View GitHub Profile
#include<stdio.h>
struct Alma {
Alma& foo() { return *this; }
virtual void bar() { printf("alma"); }
};
struct Belma: public Alma {
void bar() { printf("belma"); }
};
@madbence
madbence / gist:10665519
Created April 14, 2014 17:02
My preferred JavaScript coding style :3
// multiple vars
var fs = require('fs');
var net = require('net');
// no whitespace after function name
// no whitespace after `(` and before `)`, like real text
// whitespace before block scope, open in the same line
// camelCase function names
function foo(bar, baz) {
// ident with 2 spaces
struct foo {
static int bar;
int baz;
foo():baz(bar){}
foo(int woof):baz(woof){}
};
int foo::bar = 3;
int main() {
#include <math.h>
#include <stdlib.h>
#if defined(WIN32) || defined(_WIN32) || defined(__WIN32__)
#include <windows.h>
#endif
#include <GL/gl.h>
#include <GL/glu.h>
#include <GL/glut.h>
#include <stdio.h>
const int screenWidth = 600;
function Foo(a,b,c) {
this.a=a;
this.b=b;
this.c=c;
}
function a1() {
return this.b();
};
//...
struct foo {
virtual int bar() = 0;
virtual int baz() = 0;
};
struct qux: public virtual foo {
int bar() {
return baz();
}
};
var webdriver = require('selenium-webdriver');
var driver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.chrome()).
build();
driver.get('http://www.google.com');
driver.findElement(webdriver.By.name('q')).sendKeys('webdriver');
driver.findElement(webdriver.By.name('btnG')).click();
driver.wait(function() {
#define GLEW_STATIC
#include <GL/glew.h>
#include <GLFW/glfw3.h>
#include <thread>
#include <cmath>
#define GLSL(src) "#version 150 core\n" #src
const char* vertex = GLSL(
in vec2 position;
### Keybase proof
I hereby claim:
* I am madbence on github.
* I am lennon (https://keybase.io/lennon) on keybase.
* I have a public key whose fingerprint is 0687 E8DA D652 0FAF E783 8106 0A0D 4ABE 6A86 3BDD
To claim this, I am signing this object:
var net = require('net');
net.createServer(function(sock) {
console.log('rikveszt!');
var start = new Date().getTime();
var payload = '';
for (var i = 0; i < 10000; i++) {
payload += 'LoL';
}
var j = 0;