Skip to content

Instantly share code, notes, and snippets.

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

Paul Redmond paulredmond

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

@paulredmond
paulredmond / integrate.sh
Created December 18, 2015 20:45
Rebuild an integration branch from master and reapply branches previously merged into integration but that have not been merged to master
#!/usr/bin/env bash
# Update the origin remote and prune it
updateOrigin()
{
git fetch origin
git remote prune origin
}
# List branches that are merged into integration, but not master
#
# 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 / functions.php
Created October 6, 2013 05:14
Custom author rewrite urls for WordPress
<?php
// Custom author URI structure even if the site
// is configured to use a custom structure, ie: /my-prefix/%postname%/
add_filter('init', function () {
global $wp_rewrite;
$wp_rewrite->author_structure = '/' . $wp_rewrite->author_base. '/%author%';
// Only uncomment the flush_rules() method call if things are not working.
// After the rules are flushed (refresh page), this can be commented out again.
@paulredmond
paulredmond / comment.rb
Created January 9, 2014 16:22
Need help figuring out submitting a form for polymorphic models from associated controller
# models/comment.rb
class Comment < ActiveRecord::Base
belongs_to :commentable, polymorphic: true
validates :name, presence: true
end
@paulredmond
paulredmond / routes.php
Created February 20, 2016 15:51
Development Route for Debugging PHP Info in Lumen
<?php
if (
env('APP_DEBUG') === true
&& !preg_match('/(prd|production|prod)/', env('APP_ENV'))
) {
$app->get('_/phpinfo', function () {
ob_start();
phpinfo();
$response = ob_get_contents();
@paulredmond
paulredmond / pngout.rb
Created February 10, 2012 17:29
pngout homebrew formula
require 'formula'
class Pngout < Formula
url 'http://static.jonof.id.au/dl/kenutils/pngout-20110722-darwin.tar.gz'
homepage 'http://www.jonof.id.au/kenutils'
md5 'ce70a9d70e08b1920e5ac88d130d0eb9'
version '20110722'
def install
prefix.install Dir['*']