Skip to content

Instantly share code, notes, and snippets.

View paulredmond's full-sized avatar
🏴‍☠️

Paul Redmond paulredmond

🏴‍☠️
View GitHub Profile
@paulredmond
paulredmond / gist:3161957
Created July 23, 2012 04:21 — forked from madrobby/gist:3161015
detect retina support
function isRetina(){
return (('devicePixelRatio' in window && devicePixelRatio > 1) ||
('matchMedia' in window && matchMedia("(-moz-device-pixel-ratio:1.0)").matches))
}
@paulredmond
paulredmond / .shellaliases
Created July 27, 2012 16:29 — forked from justinrainbow/.shellaliases
My shell aliases
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 / 0_selector_hacks.scss
Created December 6, 2012 16:49 — forked from chriseppstein/0_selector_hacks.scss
This gist demonstrates some uses of the new sass feature: Passing content blocks to mixins.
@mixin ie6 { * html & { @content } }
#logo {
background-image: url("/images/logo.png");
@include ie6 { background-image: url("/images/logo.gif"); }
}

Awesome PHP

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

Composer

Composer Related

#
# 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
@paulredmond
paulredmond / Capfile
Last active October 24, 2017 18:17
Capistrano deploy recipe for Media Temple Grid Service. This particular recipe is for a Railsless deploy of WordPress.
require 'rubygems'
require 'railsless-deploy'
load 'config/deploy'
@paulredmond
paulredmond / .php_cs.laravel.php
Created June 21, 2019 03:56 — forked from laravel-shift/.php-cs-fixer.php
PHP CS Fixer - Laravel Ruleset
<?php
use PhpCsFixer\Config;
use PhpCsFixer\Finder;
$rules = [
'phpdoc_indent' => true,
'binary_operator_spaces' => [
'operators' => ['=>' => null]
],
@paulredmond
paulredmond / README.md
Created November 19, 2019 20:27 — forked from tomazzaman/README.md
Kill supervisor on Docker when any of the services fail

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 / remote-tail.js
Created May 18, 2011 23:15 — forked from justinrainbow/remote-tail.js
Tail a remote file on multiple servers with Node.js
var sys = require('sys'),
spawn = require('child_process').spawn,
// args from command line
filename, servers;
if (process.ARGV.length < 4) {
return sys.puts("Usage: node remote-tail.js filename server1 [serverN]");
}