This file contains hidden or 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
composer install || php composer.phar install || php ~/composer.phar install || echo "Please run composer install" |
This file contains hidden or 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
# Install composer to /usr/loca/bin/composer | |
curl -sS https://getcomposer.org/installer | php -- --filename=composer --install-dir=/usr/local/bin | |
# With sudo | |
curl -sS https://getcomposer.org/installer | sudo php -- --filename=composer --install-dir=/usr/local/bin | |
# For scripting, install or self-update | |
if type composer &> /dev/null; then | |
composer self-update | |
else |
This file contains hidden or 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
port = ENV["HOST_PORT"] || 8080 | |
Vagrant.configure("2") do |config| | |
# Ubuntu 14.04 LTS | |
config.vm.box = "ubuntu/trusty64" | |
config.vm.network "forwarded_port", guest: 80, host: port | |
config.vm.provision "shell", path: "vagrant/provision.sh" | |
end |
This file contains hidden or 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 php | |
<?php | |
$input = file_get_contents("php://stdin"); | |
$data = json_decode($input); | |
if (is_null($data)) { | |
fwrite(STDERR, "Unable to parse JSON\n"); | |
exit(1); | |
} | |
print json_encode($data, JSON_PRETTY_PRINT); |
This file contains hidden or 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
# modules/sshkeys/manifests/init.pp | |
define sshkeys ( | |
$home_directory = '/root', | |
$authorized_keys, | |
) { | |
exec { "/usr/bin/test -e ${home_directory}": } | |
file { "${home_directory}/.ssh": |
This file contains hidden or 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 | |
/** | |
* Exception to indicate the response should redirect to a different URI. | |
*/ | |
class RedirectException extends \Exception | |
{ | |
/** @var int Status code */ | |
protected $code = 302; | |
/** @var string URI to use in the Location header */ | |
protected $message = "/"; |
This file contains hidden or 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 | |
/** | |
* Iterates through an object or array and resolves or "flatten" and $ref | |
* properties by reading the object the reference points to and augmenting | |
* the containing object with the result. | |
* | |
* This class works with any stdClass object, but is mostly likely to be | |
* useful for working with JSON Schema documents and Swagger configurations. | |
*/ |
This file contains hidden or 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 | |
/** | |
* Allow PHP to autoload classes from a specific directory. | |
* | |
* https://gist.github.com/pjdietz/05f1fcef4ca3bd7d6448 | |
* | |
* Classes MUST be one class or interface per file with the name of the class or interface matching the filename | |
* (minus .php). | |
* |
This file contains hidden or 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
import java.util.concurrent.atomic.AtomicInteger; | |
/** | |
* Performs an operation after a predetermined number of actions occur. | |
*/ | |
abstract public class CountDown { | |
private AtomicInteger count; | |
/** |
This file contains hidden or 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
http://us.battle.net/api/wow/character/{realm}/{character}?fields=quests |