Skip to content

Instantly share code, notes, and snippets.

Form::macro('multiselect', function($name, $list = [], array $selected = [], $options = [])
{
$options['name'] = $name;
$html = array();
if (is_string($selected)) $selected[$selected] = $selected;
//dd($list, $selected);
foreach ($list as $value => $display)
{
$sel = isset($selected[$value])?' selected="selected"':'';

How we use git-flow

The commands

Make it work locally

$ git flow init

Create a issue on github (e.g. Start blog application).

@jeremyvaught
jeremyvaught / check_machine_name.php
Last active December 26, 2015 23:39
check machine name for setting the environment in laravel
#!/usr/bin/env php
# or type `hostname` in bash
<?php
var_dump(gethostname());
@jeremyvaught
jeremyvaught / other_option.sh
Last active December 28, 2015 13:09
My custom BASH prompt setup
This incorporates the file directory name I'm in (in purple), as well as the git branch I'm in (in green), in brackets
export PS1='\[\033[01;34m\]\W\[\033[00m\] [$(__git_ps1 "\[\033[01;32m\]%s\[\033[00m\]")] $ '
Colorless
export PS1='\W [$(__git_ps1 "%s")] $ '
Gray bold with green - the one I've settled on for now
export PS1='\[\033[01;02m\]\W\[\033[00m\] $(__git_ps1 "[\[\033[01;32m\]%s\[\033[00m\]]") $ '
@jeremyvaught
jeremyvaught / customize_bash.sh
Created November 18, 2013 14:10
This incorporates the file directory name I'm in (in purple), as well as the git branch I'm in (in green), in brackets export PS1='\[\033[01;34m\]\W\[\033[00m\] [$(__git_ps1 "\[\033[01;32m\]%s\[\033[00m\]")] $ ' Colorless export PS1='\W [$(__git_ps1 "%s")] $ ' Gray bold with green - the one I've settled on for now export PS1='\[\033[01;02m\]\W\[…
#
@jeremyvaught
jeremyvaught / my_steps_to_create_virtual_box.sh
Last active December 31, 2015 13:29
My notes on installing Ubuntu 13.10 Server in VirtualBox on my Mac. Also, this is not intended to be an actual shell script, just a list of commands to copy and paste
# ... pre-writing it down, but basically install the OS
# then update
sudo apt-get update
sudo apt-get upgrade
sudo apt-get dist-upgrade
# Ubuntu comes with tasksel, so going with that
sudo tasksel # choose openSSH server and LAMP, Basic Ubuntu Server will have already been chosen. These can also be chosen during the install process but I found it may make for a less smooth install process
# So I can install the iso and other things into the future
@jeremyvaught
jeremyvaught / laravel_git_upstream.sh
Created December 18, 2013 16:08
Setting new upstream in Laravel to get occasional updates
# pulled from http://niallobrien.me/2013/03/installing-and-updating-laravel-4 which I referenced often
mkdir newinstall.dev
cd newinstall.dev
git clone git@github.com:laravel/laravel.git .
composer udpate # It's installed globally
@jeremyvaught
jeremyvaught / .tmux.conf
Created January 16, 2014 02:35
I've cobbled this together from reading different tutorials and such. I'm a tmux noob, but this seems to get the job done for me so far. I run it in iTerm2
# Set prefix key to Ctrl-a
unbind-key C-b
set-option -g prefix C-a
# tell tmux to use 256 colour terminal
set -g default-terminal "screen-256color"
# Key bindings
# navigate panes using jk, and ctrl+jk (no prefix)

Likely fake, but good stuff, and I thought I'd keep it here as well so I don't lose it. I originally found it over here but have seen it other places.


Below are 20 wise marriage tips from a man that was recently divorced. You wouldn’t normally think that a divorced man would give good advice on being a husband, but this man has been through enough hardship to know what is worth fighting for:

###MARRIAGE ADVICE I WISH I WOULD HAVE HAD:

Obviously, I’m not a relationship expert. But there’s something about my divorce being finalized this week that gives me perspective of things I wish I would have done different… After losing a woman that I loved, and a marriage of almost 16 years, here’s the advice I wish I would have had…

@jeremyvaught
jeremyvaught / DNSMasq
Created May 27, 2014 15:33
DNSMasq, because I can never remember what it's called when I need to make an update
From http://passingcuriosity.com/2013/dnsmasq-dev-osx, a fantastic resource. Pasting below in case it goes away
Most web developers will be familiar with the process of updating your /etc/hosts file to direct traffic for coolproject.dev to 127.0.0.1. Most will also be familiar with the problems of this approach:
it requires a configuration change every time you add or remove a project; and
it requires administration access to make the change.
Installing a local DNS server like Dnsmasq and configuring your system to use that server can make these configuration changes a thing of the past. In this post, I’ll run through the process of: