Skip to content

Instantly share code, notes, and snippets.

Wojciech Sznapka wowo

Block or report user

Report or block wowo

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
View composer.json
"name": "wowo/log-demo",
"type": "project",
"require": {
"monolog/monolog": "^2.0"
"authors": [
"name": "Wojciech Sznapka",
"email": ""
View fastest-fx.php
$poundToEuro = (float) simplexml_load_file('')->xpath("//*[@currency='GBP']")[0]['rate'];
wowo / api.php
Created Aug 28, 2015
Simple api to capture and test API callbacks
View api.php
$log = __DIR__ . '/api.log';
$payload = json_decode(file_get_contents('php://input'), true) ?: $_POST;
"[%s] (%s - %s) %s\n",
(new \DateTime())->format('Y-m-d H:i:s'),
wowo / pre-commit
Last active Aug 29, 2015
Basic pre-commit git hook
View pre-commit
exec < /dev/tty
if [[ $rc != 0 ]] ; then
echo -n "It looks like some of your tests failed. "
exit $rc;
View EmailValueObject.php
final class EmailValueObject
private $mailbox;
private $host;
public function __construct($email)
if (false === strpos($email, '@')) {
View manager4-amf.php
/* $Id$ */
set_include_path(get_include_path() . ':' . __DIR__ . '/../lib');
include 'SabreAMF/Client.php'; //Include the client scripts
spl_autoload_register(function($classname) {
$filename = str_replace(array('_', '\\'), DIRECTORY_SEPARATOR, $classname) . '.php';
include $filename;
wowo / IsolatedTestsTrait.php
Created Oct 24, 2013
IsolatedTestsTrait helps with running functional/integration tests in isolation, with same start state for each test. It's also optimized, keeping in mind performance concerns.
View IsolatedTestsTrait.php
namespace XSolve\CashflowBundle\Tests;
use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Bundle\FrameworkBundle\Console\Application;
use Doctrine\DBAL\Driver\PDOSqlite\Driver as PDOSqliteDriver;
require_once(__DIR__ . IsolatedTestsTrait::$kernelRootDir . '/AppKernel.php');
wowo / api.php
Created Sep 6, 2013
That's why I like FOS REST in #Symfony
View api.php
* @View()
* @Get("/leads/{id}")
* @ParamConverter("offer", class="SomeBundle:Offer\OfferLead")
public function getLeadAction(OfferLead $lead)
return array('lead' => $lead);
wowo /
Last active Mar 19, 2020
Guesing gender based on name in PHP
# install gender
sudo apt-get install libpcre3-dev
sudo pecl install gender
# generate data
mkdir ~/gender
sudo pear run-scripts pecl/gender
# eneble module
echo '' >> /etc/php5/cli/php.ini
wowo /
Created Oct 23, 2012
Post-update script to update other repo
echo "*** Running $0"
echo "*** Resetting working copy of"
(cd $GIT_DIR
git --git-dir=.git/ reset --hard HEAD > /dev/null)
echo "*** Updating"
(cd $GIT_DIR
You can’t perform that action at this time.