Skip to content

Instantly share code, notes, and snippets.

View lenlorijn's full-sized avatar

Len Lorijn lenlorijn

View GitHub Profile
@shark0der
shark0der / gist:0b2b1b565c433d68a75d
Created May 18, 2015 02:37
Money indicator: Each morning you're given $1440, $1 for every minute of your life. Spend it wisely.
#!/usr/bin/python
import appindicator, pynotify, gtk, os, sys
import threading
from datetime import datetime
from datetime import timedelta
try:
import glib
except:
@victorb
victorb / pre-commit
Created January 9, 2014 14:05
Make sure there is no var_dump, die or console.log in new changes
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# # Installation:
# touch .git/hooks/pre-commit
# chmod u+x .git/hooks/pre-commit
@wowo
wowo / PHPUnit way to mock Doctrine2 Entity Manager.php
Created November 1, 2011 20:22
PHPUnit's way to mock Doctrine2 Entity Manager
<?php
class AbstractManagerBase extends \PHPUnit_Framework_TestCase
{
protected function getEmMock()
{
$emMock = $this->getMock('\Doctrine\ORM\EntityManager',
array('getRepository', 'getClassMetadata', 'persist', 'flush'), array(), '', false);
$emMock->expects($this->any())
->method('getRepository')