Skip to content

Instantly share code, notes, and snippets.

templates:
global:
transmission:
host: localhost
port: 9091
addpaused: No
ratio: 1.5
bandwidthpriority: -1
clean_transmission:
host: localhost
@chadrien
chadrien / Guardfile
Last active August 29, 2015 13:56
CakePHP unit tests guardfile
group 'tests' do
guard 'shell' do
watch(%r{^(?:(?!(?:Plugin|Test)/)(.+)\.php)*$}) {|m| `cake test app #{m[1]}` }
watch(%r{^Plugin/([^/]+)/(?:(?!Test)(.+)\.php)*$}) {|m| `cake test #{m[1]} #{m[2]}` }
watch(%r{^Test/Case/(.+)Test\.php$}) {|m| `cake test app #{m[1]}` }
watch(%r{^Plugin/([^/]+)/Test/Case/(.+)Test\.php$}) {|m| `cake test #{m[1]} #{m[2]}` }
end
end
@chadrien
chadrien / Dockerfile
Last active August 29, 2015 14:06
Docker/fig pour Magento avec apache/php53
FROM ubuntu
MAINTAINER chadrien <chadrien@chadrien.fr>
ENV DEBIAN_FRONTEND noninteractive
RUN echo "deb http://archive.ubuntu.com/ubuntu precise universe main multiverse restricted" > /etc/apt/sources.list
RUN echo "deb http://security.ubuntu.com/ubuntu/ precise-security universe main multiverse restricted" >> /etc/apt/sources.list
RUN apt-get update
RUN apt-get upgrade
<?php
class Order extends AppModel {
private $__Email = null;
public function afterSave($created, $options = array()) {
if ($created) {
$this->__notifyClient();
$this->__notifyAdmin();
}
#!/usr/bin/env bash
REMOTE_DATABASE_NAME=""
REMOTE_SQL_USER=""
REMOTE_SQL_PASS=""
LOCAL_SQL_USER=""
LOCAL_SQL_PASS=""
LOCAL_DATABASE_NAME=""
@chadrien
chadrien / cakeunit4intellij.php
Last active August 29, 2015 14:11
CakePHP2 tests in Intellij
<?php
// Clean argument values
$phpStormRunner = null;
$cleanedArgv = array();
foreach ($_SERVER['argv'] as $key => $value) {
if (strpos($value, 'ide-phpunit.php') === false) {
$cleanedArgv[] = $value;
} else {
$phpStormRunner = $value;
}
@chadrien
chadrien / README.md
Created April 16, 2015 15:55
config.json file for Docker Machine on RunAbove

How to use

  • Copy to $HOME/.docker/machine/machines/{{machine_name}}/config.json
  • Set values for the following fields:
    • Username
    • Password
    • TenantName
    • TenantId
    • Region
  • MachineName
@chadrien
chadrien / README.md
Last active August 29, 2015 14:21
Configure boot2docker for dns-gen

Init boot2docker

Create boot2docker instance and start it

$ boot2docker init --dhcp=false --hostip=172.16.0.1
$ boot2docker up

Configure the instance

@chadrien
chadrien / chadrien.zsh-theme
Last active September 2, 2015 08:28
ZSH Theme
###
### symbols
###
# segments
[ -z "$SEGMENT_SEPARATOR" ] && SEGMENT_SEPARATOR=''
[ -z "$RSEGMENT_SEPARATOR" ] && RSEGMENT_SEPARATOR=''
## git
[ -z "$GIT_CLEAN_SYMBOL" ] && GIT_CLEAN_SYMBOL='%F{black}✔'
@chadrien
chadrien / README.md
Last active November 6, 2015 11:00
X application from docker on OS X
  • brew install socat
  • brew cask install xquartz
  • Restart
  • socat TCP-LISTEN:6000,reuseaddr,fork UNIX-CLIENT:\"$DISPLAY\" &
  • docker run -e DISPLAY=XXX:0 jess/geary where XXX is the IP from ifconfig vboxnet0