Skip to content

Instantly share code, notes, and snippets.

@paulredmond
paulredmond / README.md
Created Nov 19, 2019 — forked from tomazzaman/README.md
Kill supervisor on Docker when any of the services fail
View README.md

Killing supervisor if any of it's child processes fail

The trick is to only register the listener for events that indicate failure, namely

  • PROCESS_STATE_STOPPED
  • PROCESS_STATE_EXITED
  • PROCESS_STATE_FATAL

Once they do, we should send a SIGQUIT to Supervisor.

@paulredmond
paulredmond / .php_cs.laravel.php
Created Jun 21, 2019 — forked from laravel-shift/.php_cs.laravel.php
PHP CS Fixer - Laravel Ruleset
View .php_cs.laravel.php
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'phpdoc_indent' => true,
'binary_operator_spaces' => [
'operators' => ['=>' => null]
],
@paulredmond
paulredmond / Capfile
Last active Oct 24, 2017
Capistrano deploy recipe for Media Temple Grid Service. This particular recipe is for a Railsless deploy of WordPress.
View Capfile
require 'rubygems'
require 'railsless-deploy'
load 'config/deploy'
View cap recipe for media temple grid server
#
# After running cap deploy:cold, You'll need to remove all files from the
# domains/yourdomain.com/html directory and turn the html directory into a
# symlink that links to ./current which is also a symlink setup by capistrano.
#
# install the mt-capistrano gem, not sure if it is really needed in most situations
require 'mt-capistrano'
# Configure these
View awesome-php.md

Awesome PHP

A list of amazingly awesome PHP libraries, resources and shiny things.

Composer

Composer Related

@paulredmond
paulredmond / 0_selector_hacks.scss
Created Dec 6, 2012 — forked from chriseppstein/0_selector_hacks.scss
This gist demonstrates some uses of the new sass feature: Passing content blocks to mixins.
View 0_selector_hacks.scss
@mixin ie6 { * html & { @content } }
#logo {
background-image: url("/images/logo.png");
@include ie6 { background-image: url("/images/logo.gif"); }
}
View .shellaliases
alias mongo.start="mongod run --config `brew --prefix mongodb`/mongod.conf"
alias apache.start="sudo /usr/sbin/apachectl start"
alias apache.stop="sudo /usr/sbin/apachectl stop"
# alias cake="${dev}/framework/cake/console/cake"
alias cakephp="${dev}/framework/cake/console/cake"
alias run.elasticsearch='elasticsearch -f -D es.config=/usr/local/Cellar/elasticsearch/0.18.5/config/elasticsearch.yml'
@paulredmond
paulredmond / gist:3161957
Created Jul 23, 2012 — forked from madrobby/gist:3161015
detect retina support
View gist:3161957
function isRetina(){
return (('devicePixelRatio' in window && devicePixelRatio > 1) ||
('matchMedia' in window && matchMedia("(-moz-device-pixel-ratio:1.0)").matches))
}
@paulredmond
paulredmond / gist:3130269
Created Jul 17, 2012 — forked from w33ble/gist:3124943
bashrc with git ps1
View gist:3130269
WHITE="\[\033[00m\]"
BLACK="\[\033[01;30m\]"
RED="\[\033[0;31m\]"
LIGHT_RED="\[\033[1;31m\]"
GREEN="\[\033[0;32m\]"
LIGHT_GREEN="\[\033[1;32m\]"
YELLOW="\[\033[0;33m\]"
BLUE="\[\033[0;34m\]"
PURPLE="\[\033[0;35m\]"
CYAN="\[\033[0;36m\]"
View timeout.php
<?php
class TimeoutException extends RuntimeException {}
class Timeout
{
private $active;
public function set($seconds)
{