Skip to content

Instantly share code, notes, and snippets.

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

Paul Redmond paulredmond

🏴‍☠️
View GitHub Profile
@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'
#
# 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

Awesome PHP

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

Composer

Composer Related

@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"); }
}
@paulredmond
paulredmond / traceroute-output
Created November 13, 2012 18:35
Traceroute to yui.yahooapis.com
traceroute yui.yahooapis.com
traceroute to fo-anyycs-l.ay1.b.yahoodns.net (216.115.97.236), 64 hops max, 52 byte packets
1 192.168.8.1 (192.168.8.1) 0.620 ms 0.356 ms 0.461 ms
2 10.81.224.1 (10.81.224.1) 6.282 ms 7.849 ms 11.538 ms
3 ip68-2-4-37.ph.ph.cox.net (68.2.4.37) 11.341 ms 6.473 ms 5.649 ms
4 70.169.75.118 (70.169.75.118) 10.828 ms 12.486 ms 7.519 ms
5 mcdldsrj01-ae2.0.rd.ph.cox.net (70.169.76.225) 6.506 ms 9.685 ms 5.624 ms
6 langbprj01-ae1.rd.la.cox.net (68.1.1.13) 22.028 ms 99.789 ms 23.220 ms
7 exchange-cust1.la1.equinix.net (206.223.123.16) 27.044 ms 31.842 ms 46.361 ms
8 * * *
@paulredmond
paulredmond / get-age.php
Created September 27, 2012 19:16
Get age with PHP's DateTime
<?php
$birthday = '01/01/1970';
$age = DateTime::createFromFormat('m/d/Y', $birthday)
->diff(new DateTime('now'))
->y;
@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 / 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 / gist:3130269
Created July 17, 2012 15:58 — forked from w33ble/gist:3124943
bashrc with git ps1
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\]"
@paulredmond
paulredmond / timeout.php
Created July 11, 2012 21:41 — forked from avalanche123/timeout.php
timeouts in php
<?php
class TimeoutException extends RuntimeException {}
class Timeout
{
private $active;
public function set($seconds)
{