Skip to content

Instantly share code, notes, and snippets.

@JesseObrien
JesseObrien / deploy.yml
Created September 5, 2014 13:24
Deploy script for ansible
- hosts: web
vars_files:
- vars.yml
tasks:
- name: Clone Repository
git: repo="git@repo.git" dest=/home/deploy/site version={{ branch }}
notify:
- restart php-fpm service
- restart nginx service
@JesseObrien
JesseObrien / keybase.md
Created September 3, 2014 11:55
Keybase Proof

Keybase proof

I hereby claim:

  • I am jesseobrien on github.
  • I am jesseobrien (https://keybase.io/jesseobrien) on keybase.
  • I have a public key whose fingerprint is 9A17 B682 F65F 4326 FA1A A750 FA07 3D72 55DC A4AB

To claim this, I am signing this object:

@JesseObrien
JesseObrien / sentry.php
Created September 3, 2014 00:19
Sentry laravel hook
App::error(function(Exception $exception, $code)
{
// Sentry exception logging
$client = new Raven_Client(Config::get('app.sentry-key'));
$client->captureException($exception);
Log::error($exception);
});
@JesseObrien
JesseObrien / sed.sh
Created June 4, 2014 18:54
Add soft delete traits to every PHP file in a directory.
#!/usr/bin/env bash
sed -i 's/<?php\(.*\)/<?php\1\n\nuse Illuminate\Database\Eloquent\SoftDeletingTrait;/' *.php
sed -i 's/class \(.*\) {/class \1 {\n\n\tuse SoftDeletingTrait;/' *.php
@JesseObrien
JesseObrien / composer.json
Created March 14, 2014 20:18
Add sentry exceptions to Laravel.
"require": {
"raven/raven": "0.8.*@dev"
}
@JesseObrien
JesseObrien / validatable.php
Created February 28, 2014 21:22
Validatable trait
<?php
use Validator;
trait Validatable {
/**
* Validator instance for this check
* @var Validator
*/
@JesseObrien
JesseObrien / titles.html
Created February 19, 2014 19:46
Titles html
<select name="title" id="title">
<option value="">No Title</option>
<option value="Mr">Mr</option>
<option value="Mrs">Mrs</option>
<option value="Miss">Miss</option>
<option value="Ms">Ms</option>
<option value="Master">Master</option>
<option value="Admiral">Admiral</option>
<option value="Archbsh">Archbishop</option>
<option value="Att Gen">Attorney General</option>
@JesseObrien
JesseObrien / vagrantfile.rb
Created February 11, 2014 16:02
If you have networking issues with vagrant, fix them with these!
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--natdnshostresolver1", "on"]
vb.customize ["modifyvm", :id, "--natdnsproxy1", "on"]
end
@JesseObrien
JesseObrien / .gitconfig
Created January 30, 2014 19:30
Example git config with aliases.
[user]
name = Example Person
email = person@example.com
[color]
ui = always
[push]
default = matching