Skip to content

Instantly share code, notes, and snippets.

set show-id = true
set show-refs = true
bind main P !git push origin
bind main p !git pull --rebase
bind main f !git fetch --all
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 / AppController.php
Last active November 26, 2021 10:49
CakePHP force trailing slash
<?php
App::uses('TrailingSlashUtil', 'Lib');
App::uses('Controller', 'Controller');
class AppCpontroller extends Controller {
public function redirect ($url, $status = null, $exit = true) {
$url = TrailingSlashRouter::url($url);
@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 / .fishrc
Last active July 3, 2017 03:15
My fishrc
# vim: ft=fish
function __fish_init_boot2docker_env
for dockerVar in (boot2docker shellinit 2>/dev/null | sed -e 's/export/set -xU/' -e 's/=/ /');
eval $dockerVar
end
end
function boot2docker
command boot2docker $argv
if test "$argv[1]" = "up"
@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 / install.sh
Last active March 19, 2019 00:50
Install mailcatcher on AlwaysData
#!/bin/bash
git clone https://github.com/sstephenson/rbenv.git ~/.rbenv
git clone https://github.com/sstephenson/ruby-build.git ~/.rbenv/plugins/ruby-build
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
rbenv install 1.9.3-p551
rbenv global 1.9.3-p551
gem install --no-ri --no-rdoc mailcatcher -v0.5.12
rbenv rehash