Skip to content

Instantly share code, notes, and snippets.

Tom Van Looy tvlooy

Block or report user

Report or block tvlooy

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tvlooy
tvlooy / 01.php
Created Jun 23, 2011 — forked from smasty/01.php
10 PHP One Liners to Impress Your Friends
View 01.php
<?
foreach(range(1, 10) as $i) echo $i * 2 . " ";
@tvlooy
tvlooy / image_gallery.html
Created Nov 24, 2011
simple jQuery image gallery
View image_gallery.html
View run all in one => fails
[tvl@novo /var/www/html/leeshoek.home.ctors.net/Symfony]
$ app/console behat -e=test
Functionaliteit: Gebruiker moet gebruikers kunnen verwijderen
Om gebruikers te kunnen verwijderen
Met een beheerder
Moet ik een verwijder knop kunnen gebruiken
Scenario: Roep knop op als leerkracht # src/Ctors/ReadingCornerBundle/Features/User/remove.feature:7
Gegeven ik ben ingelogd als "leerkracht" # Ctors\ReadingCornerBundle\Features\Context\ReadingCornerContext::ikBenIngelogdAls()
Als ik naar "/user/1/remove" ga # Ctors\ReadingCornerBundle\Features\Context\ReadingCornerContext::visit()
@tvlooy
tvlooy / BabeRotate.php
Created Dec 16, 2011
The babe rotator - V2
View BabeRotate.php
<?php
function jpg ($file) { return substr($file, -4) == '.jpg'; }
$imgs = array_filter(scandir('.'), 'jpg');
$max = count($imgs);
shuffle($imgs);
?>
<html>
<body>
<img src="<?php echo $imgs[0]; ?>" id="cur_img" onclick="next();" height="100%" />
<img src="<?php echo $imgs[1]; ?>" id="nxt_img" onclick="next();" style="display: none;" />
@tvlooy
tvlooy / feestdagen.php
Last active Jul 28, 2019
Feestdagen berekenen
View feestdagen.php
<?php
// (c) Tom Van Looy <tom@ctors.net> https://ctors.net/isc_license.txt
// Alle feestdagen kunnen berekend worden, de berekende zijn allemaal
// afhankelijk van pasen. PHP heeft een functie easter_date().
// Makkie dus. Hoe easter_date() zelf werkt kan je hier raadplegen:
// https://github.com/php/php-src/blob/master/ext/calendar/easter.c
// Geen parameter? Doen we gewoon dit jaar toch.
@tvlooy
tvlooy / facebook-blocker.sh
Created May 7, 2012
How to block facebook in a very funny way
View facebook-blocker.sh
#!/bin/bash
while [ TRUE ]; do
detect=$(netstat -an | grep `dig +short www.facebook.com` | grep ESTA | wc -l)
if [ $detect -ne 0 ]; then
osascript -e "set Volume 7"
say -v Zarvox "computer says no, `whoami`"
killall Safari
sleep 10
fi
@tvlooy
tvlooy / rentplus_poc.php
Created May 31, 2012
Rentplus SOAP proof of concept
View rentplus_poc.php
<?php
class XmlSerializer {
private static $xmlns = 'www.rentplus.be/webservices/';
public static function toXml($obj) {
$class = get_class($obj);
$xml = '<?xml version="1.0" standalone="yes"?>' .
'<ds' . $class . ' xmlns="' . self::$xmlns . $class . '.xsd">' .
self::serialize($obj) .
@tvlooy
tvlooy / gist:3795348
Created Sep 27, 2012
SensioLabsDesktop segfault
View gist:3795348
[tvl@orion ~]
$ uname -a
Linux orion 3.2.0-31-generic #50-Ubuntu SMP Fri Sep 7 16:16:45 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
[tvl@orion ~]
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 12.04.1 LTS
Release: 12.04
View tijdregistratie.sh
#!/bin/bash
if [ ! -f "$1" ]; then
echo "Usage: $0 filename.txt"
exit -1
fi
filename=$1
months="Jan Feb Mar Apr May Jun Jul Aug Sep Oct Nov Dec"
linenr=0
@tvlooy
tvlooy / _phpunit.phar
Created Jan 26, 2013
phpunit zsh autocomplete support
View _phpunit.phar
#compdef phpunit.phar
_arguments -s -w \
'--list-groups[List available test groups]' \
'--tap[Report test execution progress in TAP format]' \
'--testdox[Report test execution progress in TestDox format]' \
'--colors[Use colors in output]' \
'--stderr[Write to STDERR instead of STDOUT]' \
'--stop-on-error[Stop execution upon first error]' \
'--stop-on-failure[Stop execution upon first error or failure]' \
You can’t perform that action at this time.