Skip to content

Instantly share code, notes, and snippets.

@jlaswell
jlaswell / .profile
Created December 5, 2016 16:46 — forked from bmhatfield/.profile
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else
@jlaswell
jlaswell / ReadOnly
Created December 12, 2015 15:42
Eloquent ReadOnly Trait
<?php
namespace App\Models\Traits;
use ReflectionClass;
/**
* Simply add this trait to make your model read only.
* This needs to be added to the model itself and not to the base Eloquent Model.
*/
trait ReadOnly
@jlaswell
jlaswell / laravel4-install
Last active December 15, 2015 03:19
Quick and dirty bash script for quick Laravel 4 install and update. Make sure you already have Composer and git ssh keys working. Both of these files go in /usr/local/bin
#!/bin/bash
message_prompt="Laravel 4 will be installed in the current directory.\nContinue?"
message_confirm="\nHere we go!"
message_deny="\nJust let me know when you're ready."
echo -e $message_prompt
read -p "" -n 1
if [[ ! $REPLY =~ ^[Yy]$ ]]
then
echo -e $message_deny
exit 1