#!/bin/bash
# NVM needs the ability to modify your current shell session's env vars,
# which is why it's a sourced function
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
version: '2' | |
services: | |
guacd: | |
image: guacamole/guacd | |
guac-serve: | |
image: guacamole/guacamole | |
links: | |
- guacd:guacd | |
- mysql:mysql | |
ports: |
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 | |
CONSOLE_BIN=`symfony_console_binary` | |
if [ $CONSOLE_BIN ] | |
then | |
$CONSOLE_BIN $* | |
else | |
echo "no console binary found" | |
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
#!/usr/bin/env bash | |
# MIT © Sindre Sorhus - sindresorhus.com | |
# git hook to run a command after `git pull` if a specified file was changed | |
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`. | |
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
check_run() { | |
echo "$changed_files" | grep --quiet "$1" && eval "$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
<?php | |
namespace Traits\Tests; | |
/** | |
* Mocks the entity manager | |
* | |
* Provides everything in the memory, so the tests does not depend on doctrine, | |
* which does a lot of stuff (maybe too much). This also allows to avoid to | |
* need and modify the data in the database, even if those are for the tests. |
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 | |
namespace Acme\MyBundle\Serializer\Handler; | |
use JMS\Serializer\Handler\SubscribingHandlerInterface; | |
use JMS\Serializer\EventDispatcher\Event; | |
use JMS\Serializer\GraphNavigator; | |
use JMS\Serializer\XmlSerializationVisitor; | |
use JMS\Serializer\GenericSerializationVisitor; |
This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.
Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:
getTweetsFor("domenic", function (err, results) {
// the rest of your code goes here.
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
jQuery.extend({ | |
getCachedJSON: function (url, callback) { | |
var cacheTimeInMs = 3600000; | |
var currentTimeInMs = new Date().getTime(); | |
var cache = { | |
data:null, | |
timestamp:null | |
}; |
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
#!/usr/bin/php | |
<?php | |
/** | |
* .git/hooks/pre-commit | |
* | |
* This pre-commit hooks will check for PHP error (lint), and make sure the code | |
* is PSR compliant. | |
* | |
* Dependecy: PHP-CS-Fixer (https://github.com/fabpot/PHP-CS-Fixer) | |
* |
This article is now published on my website: Prefer Subshells for Context.
NewerOlder