Skip to content

Instantly share code, notes, and snippets.

View mitchellvanw's full-sized avatar

Mitchell van Wijngaarden mitchellvanw

View GitHub Profile
<?php
interface Command {}
interface CommandHandler {
public function handle(Command $c);
}
class Register implements Command {
public function fullName() {
@mitchellvanw
mitchellvanw / .zshrc
Last active May 7, 2016 22:42
Commit already...
ca () {
message=$(curl -s whatthecommit.com/index.txt)
git add .
git commit -a -m "$message";
}
<?php
$stream = $fs->readStream($file);
// send the right headers
header("Content-Type: " . $fs->getMimetype($file));
header("Content-Length: " . $fs->getSize($file));
header("Content-disposition: attachment; filename=\"" . basename($file) . "\"");
// dump the attachement and stop the script
@mitchellvanw
mitchellvanw / slate_configuration.txt
Created October 8, 2014 13:38
Slate Configuration
# by Mitchell van Wijngaarden
config defaultToCurrentScreen true
config nudgePercentOf screenSize
config resizePercentOf screenSize
#config windowHintsIgnoreHiddenWindows false
config secondsBetweenRepeat 0.1
config checkDefaultsOnLoad true
config focusCheckWidthMax 3000
config windowHintsSpread true
@mitchellvanw
mitchellvanw / setup_laravel.sh
Created July 14, 2014 20:52
Setup a clean Laravel 4 installation
#!/bin/sh
git clone -o laravel -b develop https://github.com/laravel/laravel.git $1
cd $1
git checkout --orphan master
git add .
git commit -m "Initial commit"
### Keybase proof
I hereby claim:
* I am mitchellvanw on github.
* I am mitchellvanw (https://keybase.io/mitchellvanw) on keybase.
* I have a public key whose fingerprint is 0E5B 637C 1357 D0E0 1652 FD99 67A2 6380 8632 C211
To claim this, I am signing this object:
<?php class D{private $ls = [];public function dispatch($es){if(!is_array($es)){$this->f($es);}foreach($es as $e){$this->f($e);}}public function listenOn($n,$l){$this->al($n,$l);}private function f($e){$ls=$this->gl($e->getName());if(!$ls)return;foreach($ls as $l){$l->handle($e);}}private function gl($n){if(!$this->hl($n))return;return $this->ls[$n];}private function hl($n){return isset($this->l[$n]);}private function al($n,$l){$this->ls[$n][] = $l;}}
@mitchellvanw
mitchellvanw / laravel-application-creater
Last active December 30, 2015 11:09
Install the Laravel Application Creator globally on your *nix machine.
# Installation
curl -o laravel.phar http://laravel.com/laravel.phar
chmod 755 laravel.phar
mv laravel.phar /usr/local/bin/laravel
# Usage
laravel new <application_name>