$ docker-machine create one -d virtualbox
docker-machine ssh one
edit /var/lib/boot2docker/profile (sotto debian /etc/default/docker)
EXTRA_ARGS='
| package main | |
| import ( | |
| "database/sql" | |
| "fmt" | |
| "log" | |
| "net/http" | |
| "time" | |
| "os" | |
| "strings" |
| package main | |
| import ( | |
| "fmt" | |
| "os" | |
| "os/exec" | |
| // "syscall" | |
| ) | |
| func main() { |
| class BindResult { | |
| private $data; | |
| private $errors; | |
| function __construct($data, $errors) | |
| { | |
| $this->data = $data; | |
| $this->errors = $errors; |
| <?php | |
| /** | |
| * We are used to create Commands/UseCases with a single method, | |
| * is very common to create the name of the method with `execute` | |
| * `$doSomething->execute($thisDay)` | |
| * or to create the method name repeating the expressive class name: | |
| * `$doSomething->doSomething($thisDay)`. | |
| * | |
| * This gist uses the magic call invoke |
| #!/usr/bin/env php | |
| <?php | |
| function executing($cmd) { | |
| echo $cmd.PHP_EOL; | |
| system($cmd); | |
| } | |
| function runInit($env) { | |
| executing('php app/console --env='. $env .' doctrine:database:drop --force'); |
| Feature: Build | |
| In order to build classes | |
| As a feature developer | |
| I need to have an ability to use the factory traits. | |
| Scenario: Build a Class using private methods | |
| Given a file named "Customer.php" with: | |
| """ | |
| <?php |
| liuggio = new Employee(); | |
| liuggio.createdAt = new Datetime("now") | |
| liuggio.salaryPrice = 9999999.00 | |
| liuggio.salaryCurrency = "EUR" | |
| liuggio.name = "liuggio" | |
| if not externalValidator.validate(liuggio, context) { | |
| return error | |
| } |
| <?php | |
| namespace Acme\Foo; | |
| use Symfony\Component\HttpKernel\CacheWarmer\CacheWarmerInterface; | |
| class FooCacheWarmer implements CacheWarmerInterface | |
| { | |
| public function isOptional() | |
| { |
| FS='/';NUMRESULTS=20;resize;clear;date;df -h $FS; echo "Largest Directories:"; du -x $FS 2>/dev/null| sort -rnk1| head -n $NUMRESULTS| awk '{printf "%d MB %s\n", $1/1024,$2}';echo "Largest Files:"; nice -n 19 find $FS -mount -type f -ls 2>/dev/null| sort -rnk7| head -n $NUMRESULTS|awk '{printf "%d MB\t%s\n",($7/1024)/1024,$NF}' |