This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// See http://symfony.com/doc/current/book/validation.html#validating-values-and-arrays | |
$email = $app['request']->get('email'); | |
$emailConstraint = new \Symfony\Component\Validator\Constraints\Email(); | |
$emailConstraint->message = 'Invalid email address'; | |
$errorList = $val->validate( | |
$email, | |
$emailConstraint | |
); | |
var_dump($errorList); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Abbo: basic internet | |
Modem: modem-only DOCSIS 3.0 | |
Router: Soekris / OpenBSD 5.7 | |
----- | |
Test via autoconfiguration: | |
(inet6 autoconfig in /etc/hostname.vr0) | |
Tcpdump: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<? | |
foreach(range(1, 10) as $i) echo $i * 2 . " "; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<style> | |
.images_roll_hide { | |
display: none; | |
} | |
</style> | |
</head> | |
<body> | |
<div id="images_roll" class="catch_page_block"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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;" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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) . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
syntax on | |
colors elflord | |
set tabstop=4 | |
"set softtabstop=4 | |
set expandtab | |
set number | |
"set showcmd | |
set cursorline | |
"set wildmenu | |
"set lazyredraw |