Skip to content

Instantly share code, notes, and snippets.

View blackheaven's full-sized avatar

Gautier DI FOLCO blackheaven

View GitHub Profile
@blackheaven
blackheaven / gist:8131479
Created December 26, 2013 09:05
Why I don't like dynamic types systems.
<?php
// web/index.php in Silex
// ..
$app->register(new Silex\Provider\TranslationServiceProvider(), array(
'locale' => array('fr'), // Instead of 'locale' => 'fr',
));
@blackheaven
blackheaven / policy_telldontask.rb
Created August 11, 2013 19:59
Some thoughts on OOP principles
class Ctrl
def close
user = User.new # load from somewhere
CloseAccountPolicy.new(user).apply!
puts user.inspect
end
end
# Nearly an AnemicDomainModel because some of it's behavor is externalized
class User
RMFLAGS = -f
REAL = main.c
OBJ = $(REAL:.c=.o)
EXE = tpthreads
EFFACE = clean
RM = rm
COMP = gcc
EDL = gcc
LIBS = -pthread -O3 -ffast-math
API =