Erlang Macro for getting the current function name.
https://gist.github.com/h4cc/6881797

JBB: An Artblog!

❣ Chile in a Photography ❣
Not today Justin

$LAYYYTER
Cosmic Funnies
art blog(derogatory)

#extradirty
Xuebing Du

shark vs the universe

JVL
styofa doing anything
Aqua Utopia|海の底で記憶を紡ぐ
AnasAbdin

izzy's playlists!
h
almost home
let's talk about Bridgerton tea, my ask is open

Andulka
seen from United States

seen from Malaysia

seen from Australia

seen from Vietnam
seen from Germany

seen from Malaysia

seen from Sweden
seen from United States
seen from United States
seen from United Kingdom

seen from Germany
seen from Colombia

seen from Türkiye

seen from Germany
seen from United States
seen from Spain

seen from United States

seen from Malaysia

seen from United States
seen from United States
@h4cc
Erlang Macro for getting the current function name.
https://gist.github.com/h4cc/6881797

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
PHPUnit: Helper for creating Iterator Mocks
https://gist.github.com/h4cc/6607543
PHPUnit Mock for Doctrine\ORM\Query
If you get this message from PHPUnit: 'Class "Doctrine\ORM\Query" is declared "final"' Check out the following code:
https://gist.github.com/h4cc/6595865
Erlang: Missing 'eunit/include/eunit.hrl' on Ubuntu/Debian
https://gist.github.com/h4cc/6387788
How to check if PHP running in 32bit or 64bit:
https://gist.github.com/h4cc/6318527

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Use ISO8601 date format correct for JavaScript from JMS Serializer
We ran into a 'problem', where JavaScript could not process the dates given by PHP via JMS Serializer correctly.
I found out, that the date('c') does not create timezones like the needed '+20:00', but '+2000'.
Changing the 'c' to 'Y-m-d\TH:i:sP' fixes the whole thing. JMS Serializer configuration offers this here: http://jmsyst.com/bundles/JMSSerializerBundle/master/configuration
More infos: http://www.php.net/manual/en/class.datetime.php#111532
Add a help target to your ant build.xml buildfiles
Creating a self-documenting buildfile sound reasonable, so lets do so.
I followed the idea on this site http://amazing-development.com/archives/2005/01/28/ant-help-target/ and created the following task in a project of mine:
<target name="help"> <echo>--- Help for Project X ---</echo> <echo>This buildfile is mainly used for automatic continuous integration jobs.</echo> <echo>There is also a target 'foo' for doing bar-things.</echo> <echo/> <!-- Display available targets via ant itself --> <exec executable="ant"> <arg value="-p"/> </exec> </target>
Generate external URLs from a Symfony2 route
Aim was to have a route, that will return a external url. This is not possible with Sf2, because only internal Urls can be generted by the standard framework.
But thanks to DependencyInjetion, it was quite easy to extend the UrlGenerator with the desired functionality.
Have a look at the code:
https://gist.github.com/h4cc/6112787
With this it is possible to have a named route, that will generate a external link.
UpStart respawn only when process exited with exitcode != 0
I fell for the handling of upstart with the stanza respawn documented here: http://upstart.ubuntu.com/cookbook/#respawn
A process HAS to exit with a exitcode != 0 to be restarted. Changed that to force a restart from my script.
UpStart redirect output of exec to a file
Tried to redirect the stdout and stderr output of a script started via upstart to a file. This failed in a strange way, because multiple instances of the script were started. I used this code:
exec php /home/h4cc/foo.php &> /home/h4cc/foo.log
Solutions was to use this command instead:
exec php /home/h4cc/foo.php > /home/h4cc/foo.log 2>&1
It seems as if upstarts exec gets confused by the amperesand ...

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Symfony2 Swiftmailer does not send mails in Commands.
The Symfony2 Swiftmailer does not send mails that are spooled in 'memory', because of a missing 'kernel.terminate' Event when used in a Command.
More on that: http://sgoettschkes.blogspot.de/2012/09/symfony-21-commands-and-swiftmailer.html
Solutions:
Use 'file' spooling and send mails with 'swiftmailer:spool:send'.
Add some code in the Command to flush spool by hand
$container = $this->getContainer(); $mailer = $container->get('mailer'); $spool = $mailer->getTransport()->getSpool(); $transport = $container->get('swiftmailer.transport.real'); $spool->flushQueue($transport);