Skip to content

Instantly share code, notes, and snippets.

@KuiKui
KuiKui / pre-commit.sh
Last active May 26, 2016 10:23 — forked from JJK801/pre-commit.sh
Git Pre-Commit hook for coding standards validation
#!/bin/bash
#--------------------------------------------------------------------------------------------------
# WARNING : due to a 'git stash save -u' command, check your .gitignore file before using this hook
# -> http://blog.icefusion.co.uk/git-stash-can-delete-ignored-files-git-stash-u/
#--------------------------------------------------------------------------------------------------
binary="coke"
file=".coke"
files=""
@KuiKui
KuiKui / gist:0bca576a40acebab256b
Last active August 29, 2015 14:15
Arcade Games Rules

Today I worked out a couple of principles that make arcade games fun.

First, you have to feel in control of your ship/car/man/whatever. So that when you get hit, you say “Oh, shit! I should have thrusted!” (Asteroids) instead of “Oh well, another ship gone. I wonder what hit me?” (Star Castle).

Second, you should be able to control the form of your attacks — in short, have a strategy: Qix, Space Invaders, Asteroids, Pac-Man.

<?php
$resource = new Question($id);
$persistentResource = new PersistentQuestion($resource, $this->get('redis_db'));
if (!$persistentResource->load(true)) {
throw new NotFoundHttpException(sprintf('Question with id %s not found', $id));
}
return new View($persistentResource->getObject(), 200);
@KuiKui
KuiKui / PushEvent.json
Created November 21, 2013 15:13
sample PushEvent
{
"created_at":"2013-11-21T14:56:06Z",
"payload":{
"shas":[
["5d4c9cc25e93d8a8c246622b04dbb6e8790834a2","denis.roussel@m6.fr","Create LICENSE","Denis Roussel",true]
],
"size":1,
"ref":"refs/heads/update-readme",
"head":"5d4c9cc25e93d8a8c246622b04dbb6e8790834a2"
},
# config_test.yml
doctrine:
dbal:
connections:
myconnection:
driver: pdo_sqlite
path: %kernel.cache_dir%/myconnection.sqlite.db
charset: UTF8
doctrine:
dbal:
connections:
myconnection:
host: localhost # il n’y a pas de MySQL en local sur le serveur de test
$ ./vendor/bin/vigojs path/to/tests --buildPath=/path/to/build/results
for p in 1 2 3 4 5
do
./vendor/bin/vigojs heavyTest.js --page=$p
done
@KuiKui
KuiKui / vigo1
Last active December 20, 2015 11:19
$ ./vendor/bin/vigojs path/to/tests
@KuiKui
KuiKui / .coke
Last active December 19, 2015 00:18
# Configuration file for Coke, "Enjoy sniffing your code" : https://github.com/M6Web/Coke
# Command used to launch PHP CodeSniffer (optional - default: phpcs)
command=phpcs
# Standard used by PHP CodeSniffer (required)
standard=Symfony2
# Verbose mode (optional - default: false)
verbose=true