Erlang Macro for getting the current function name.
https://gist.github.com/h4cc/6881797
AnasAbdin
I'd rather be in outer space 🛸

No title available

shark vs the universe
Lint Roller? I Barely Know Her

No title available
Acquired Stardust
No title available

izzy's playlists!
styofa doing anything

@theartofmadeline
YOU ARE THE REASON
he wasn't even looking at me and he found me

Kaledo Art
cherry valley forever

Love Begins
todays bird

oozey mess
hello vonnie
Misplaced Lens Cap

seen from United Kingdom

seen from United Kingdom

seen from United States

seen from United States

seen from United States

seen from Singapore
seen from Germany

seen from Austria
seen from Malaysia

seen from United Kingdom

seen from Singapore
seen from Chile
seen from United States
seen from United Kingdom

seen from Germany

seen from Singapore
seen from United States

seen from United Kingdom

seen from United Kingdom
seen from Belgium
@h4cc
Erlang Macro for getting the current function name.
https://gist.github.com/h4cc/6881797
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
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 ...
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);