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 php | |
<?php | |
function formatBytes($bytes, $precision = 2) { | |
$units = array('B', 'KB', 'MB', 'GB', 'TB'); | |
$bytes = max($bytes, 0); | |
$pow = floor(($bytes ? log($bytes) : 0) / log(1024)); | |
$pow = min($pow, count($units) - 1); | |
$bytes /= (1 << (10 * $pow)); | |
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
.myTransform(@argument : none) { | |
-webkit-transform: ~"@argument"(10px); | |
-moz-transform: ~"-moz-@{argument}"(10px); | |
etc.. | |
} |
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
task :upload_parameters do | |
desc 'Upload stage parameters' | |
capifony_pretty_print '--> Uploading stage parameters' | |
origin_file = "app/config/parameters.#{fetch(:stage)}.yml" | |
destination_file = deploy_to + '/' + shared_dir + '/app/config/parameters.yml' | |
run "sh -c 'if [ ! -d #{File.dirname(destination_file)} ] ; then mkdir -p #{File.dirname(destination_file)}; fi'" | |
top.upload(origin_file, destination_file) |
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 | |
VERBOSE=1 | |
IPS_FILE="/tmp/elb_ips" | |
BACKEND_VCL="/etc/varnish/backend.vcl" | |
# Does not keep newlines, but it's ok | |
read -r -d '' BACKEND_TEMPLATE <<'EOF' | |
backend internal_elb_{ELB_NUM} { | |
.host = "{ELB_IP}"; | |
.port = "80"; |
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 php | |
<?php | |
require __DIR__.'/../vendor/autoload.php'; | |
use Aws\S3\S3Client; | |
$options = getopt('a:s:d:b:c:vh'); | |
if (isset($options['h'])) { |
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
PHPUnit 5.1.4 by Sebastian Bergmann and contributors. | |
Bgy\Tests\Commanding\ConventionalCommandHandler | |
[x] Handle method properly handles command | |
Bgy\Tests\EventStore\OptimisticConcurrencyPolicy | |
[x] If expected revision is any it should not throw any exception | |
[x] If no stream or empty is expected but actual stream is not, optimistic concurrency should failed | |
[x] If a revision is expected but the stream does not exist, optimistic concurrency should failed | |
[x] If a revision is expected but different from the actual, optimistic concurrency should failed |
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 php | |
<?php | |
function wsse_header($username, $password) { | |
$nonce = hash_hmac('sha512', uniqid(null, true), uniqid(), true); | |
$created = new DateTime('now', new DateTimezone('UTC')); | |
$created = $created->format(DateTime::ISO8601); | |
$digest = sha1($nonce.$created.$password, true); | |
return sprintf( |
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 | |
# Author: Boris Guéry <guery.b@gmail.com> | |
usage() { | |
cat <<EOF | |
usage: $0 <command> [-h] [-y] [-vvv] [-d] [<args>] | |
Currently supported commands are: | |
push Push current database data to S3 | |
pull Download latest database snapshot and remove existing one | |
EOF |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> | |
<plist version="1.0"> | |
<dict> | |
<key>Ansi 0 Color</key> | |
<dict> | |
<key>Alpha Component</key> | |
<real>1</real> | |
<key>Blue Component</key> | |
<real>0.0</real> |