Skip to content

Instantly share code, notes, and snippets.

View tedslittlerobot's full-sized avatar

Stef Horner tedslittlerobot

View GitHub Profile
@tedslittlerobot
tedslittlerobot / PHP Packages
Last active December 28, 2015 15:59
A collection of packagist packages that i use frequently - for reference, and so that there's an easy place for me to find them!
## Front End
###### Intervention Images
[intervention/image](https://github.com/Intervention/image)
###### Breadcrumbs (laravel)
[davejamesmiller/laravel-breadcrumbs](https://github.com/davejamesmiller/laravel-breadcrumbs)
###### Markdown
dflydev/markdown
@tedslittlerobot
tedslittlerobot / Project Manager Filter
Last active December 30, 2015 08:59
A basic php filter for responding to questions from project managers. will improve later.
// "/((can\'t we)|(we can)|(can we) just)?.*(make [a-z] up)?(bash|bosh|bish)?(behind the scenes)?(fudge|bodge)?(quick wins?)?.*((for now)|(can\'t we)|(this (time)|(once)))?/
$prefix = '(can\'t we)|(we can)|(can we) just';
$content = '(make [a-z] up)?(bash|bosh|bish)?(behind the scenes)?(fudge|bodge)?(quick wins?)?';
$suffix = '(for now)|(can\'t we)|(this (time)|(once))';
$filter = "/({$prefix})?.*{$content}.*({$suffix})?/";
if ( preg_match( $filter, $question ) )
{
@tedslittlerobot
tedslittlerobot / OSX Port Forwarding
Created October 2, 2014 12:08
To setup Port Forwarding for Vagrant on OSX
st /etc/pf.conf
add
rdr pass on lo0 inet proto tcp from any to 127.0.0.1 port 80 -> 127.0.0.1 port 8000
after the last `rdr-anchor` (the last of the translation rules)
run
sudo pfctl -evf /etc/pf.conf
@tedslittlerobot
tedslittlerobot / elasticsearch.bash
Last active August 29, 2015 14:09
Installing Elasticsearch on Ubuntu
sudo apt-get update -y
sudo apt-get install openjdk-7-jre -y
wget -O elasticsearch.tar.gz https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-1.4.0.tar.gz
tar -xzvf elasticsearch.tar.gz
rm elasticsearch.tar.gz
@tedslittlerobot
tedslittlerobot / bash tricks
Last active September 28, 2015 09:25
Bash Tips and Tricks for Ninja...
## Copy (OSX only)
Pipe anything to `pbcopy` to copy it to the clipboard: `cat ~/.ssh/id_rsa.pub | pbcopy`
## The last argument
To insert the last argument of the previous command wherever the cursor currently is, press `alt+.` (or, on a mac, `esc+.`)
## File expansions
@tedslittlerobot
tedslittlerobot / gist:dcf2f6bd6a04a4a4d749
Created July 14, 2015 13:41
new elastic search setup script
#! /usr/bin/env bash
if [[ ! -d /etc/elasticsearch ]]; then
ARC_ELASTICSEARCH_INSTALL_VERSION=1.6.0
sudo apt-get update -y
sudo apt-get install openjdk-7-jre -y
echo "Installing elasticsearch - version ${ARC_ELASTICSEARCH_INSTALL_VERSION}"
wget https://download.elasticsearch.org/elasticsearch/elasticsearch/elasticsearch-${ARC_ELASTICSEARCH_INSTALL_VERSION}.deb
sudo dpkg -i elasticsearch-${ARC_ELASTICSEARCH_INSTALL_VERSION}.deb
@tedslittlerobot
tedslittlerobot / elcapitanerror.md
Last active September 6, 2017 16:03
Fix for AMD-Action:authenticate:SP error
@tedslittlerobot
tedslittlerobot / network-fix.md
Last active February 22, 2016 13:54
OSX Network Issue Fix
  • Open System Preferences
  • Go to the Network tab
  • Delete all of your network interfaces from the list
  • delete the file at: /Library/Preferences/SystemConfiguration/NetworkInterfaces.plist
  • restart your computer
  • Go to System preferneces -> Network
  • Re-add your network interfaces
  • Restart your computer? (may not be neccessary, but it is fun)
@tedslittlerobot
tedslittlerobot / .zshrc
Last active September 14, 2016 08:50
Reformat installation
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
# Path to your oh-my-zsh installation.
export ZSH=/Users/stefan.horner/.oh-my-zsh
# Set name of the theme to load. Optionally, if you set this to "random"
# it'll load a random theme each time that oh-my-zsh is loaded.
# See https://github.com/robbyrussell/oh-my-zsh/wiki/Themes
ZSH_THEME="pygmalion"
@tedslittlerobot
tedslittlerobot / .env.example
Last active March 9, 2017 15:16
Run Artisan Database Commands on Virtual Machine from Host Machine (RADCBMHM™)
HOST_DB_PORT=33060