Skip to content

Instantly share code, notes, and snippets.

View JPBetley's full-sized avatar
🐢
Converting tabs and spaces

Phil Betley JPBetley

🐢
Converting tabs and spaces
View GitHub Profile
@JPBetley
JPBetley / .vimrc
Created February 12, 2014 00:48
Vim Configs
set nocompatible " be iMproved
filetype off " required!
set rtp+=~/.vim/bundle/vundle/
call vundle#rc()
" let Vundle manage Vundle
" required!
Bundle 'gmarik/vundle'
@JPBetley
JPBetley / backup_database.sh
Created March 5, 2014 20:03
Simple Bash Backup Scripts
#! /bin/bash
TIMESTAMP=$(date +"%F")
BACKUP_ROOT="-------------------"
BACKUP_DIR="$BACKUP_ROOT$TIMESTAMP"
MYSQL_USER="----------------"
MYSQL=/usr/bin/mysql
MYSQL_PASSWORD="----------------"
MYSQLDUMP=/usr/bin/mysqldump
@JPBetley
JPBetley / .zshrc
Created March 21, 2014 18:25
zshrc config files
# Path to your oh-my-zsh configuration.
ZSH=$HOME/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="tatsumori"
alias rake="noglob rake"
@JPBetley
JPBetley / tatsumori.zsh-theme
Last active August 29, 2015 13:57
Oh My ZSH Theme
if [[ -z $ZSH_THEME_CLOUD_PREFIX ]]; then
ZSH_THEME_CLOUD_PREFIX='☁'
fi
function git_prompt_info() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
}
function get_pwd() {
@JPBetley
JPBetley / Homestead.yaml
Last active August 29, 2015 14:01
Homestead changes
---
authorize: /Users/tatsumori/.ssh/id_rsa.pub
keys:
- /Users/tatsumori/.ssh/id_rsa
folders:
- map: /Users/tatsumori/Code
to: /home/vagrant/Code
# Modify this file accordingly for your specific requirement.
# http://www.thegeekstuff.com
# 1. Delete all existing rules
iptables -F
# 2. Set default chain policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP
@JPBetley
JPBetley / brogrammer-routes.php
Created June 21, 2013 16:08
Funny Brogrammers Laravel Routes
<?php
// app/routes.php
// By Dayle Rees
Route::group(array('before' => 'onlybrogrammers', function()
{
// First Route
Route::get('/first', function () {
@JPBetley
JPBetley / laravel-facade-callstatic.php
Last active December 20, 2015 04:08
Laravel Facade callStatic
<?php
/**
* Handle dynamic, static calls to the object.
*
* @param string $method
* @param array $args
* @return mixed
*/
public static function __callStatic($method, $args)
@JPBetley
JPBetley / aspecttest.php
Created July 26, 2013 03:52
AspectMock Static Test
<?php
use AspectMock\Test as test;
class Foo
{
static function simpleStatic() {
return 'bees?!';
}
}
@JPBetley
JPBetley / OrderStateTest.cs
Created August 2, 2013 13:35
Order State Unit Test
// Adapted from Martin Fowler
[TestClass]
public class OrderStateTester {
private static String TALISKER = "Talisker";
private static String HIGHLAND_PARK = "Highland Park";
private Warehouse warehouse = new WarehouseImpl();
[TestInitialize]
protected void setUp() {
warehouse.add(TALISKER, 50);