Skip to content

Instantly share code, notes, and snippets.

View juniorbird's full-sized avatar

Wade Armstrong juniorbird

View GitHub Profile
@juniorbird
juniorbird / .bashrc
Created October 24, 2011 05:25
My .bashrc
source ~/dotfiles/bashrc
source ~/dotfiles/bash_aliases
@juniorbird
juniorbird / .bash_profile
Created October 24, 2011 05:37
My OSX Lion ~/.bash_profile
. /sw/bin/init.sh #make fink run
growl() { echo -e $'\e]9;'${1}'\007' ; return ; } #send alerts to growl
source ~/dotfiles/bashrc
@juniorbird
juniorbird / gist:1308475
Created October 24, 2011 06:29
Show all 256 colors of bash prompt
for code in `seq 0 255`; do echo -e "\033[38;05;${code}m$code: Test"; done
@juniorbird
juniorbird / .vimrc
Created October 26, 2011 16:10
My .vimrc
set runtimepath=~/dotfiles/vim/,~/dotfiles/vim/plugins/,$VIMRUNTIME
source ~/dotfiles/vim/vimrc
# set environment variables to say what machine we're on
# export MYMACHINE='Juarez'
# export MYMACHINE='Sandbox'
# export MYMACHINE='Laptop'
@juniorbird
juniorbird / gist:5059201
Created February 28, 2013 19:03
Windows 7 Pro Notepad Easy Hosthack Target
%windir%\system32\notepad.exe %windir%\system32\drivers\etc\hosts
@juniorbird
juniorbird / emailswithoutspacesafterimages.html
Created September 11, 2015 19:37
How to not have empty lines after images in e-mails.
<style="text/css">
.someclass a {
display: inline-block;
}
.someclass a img {
display: block;
}
</style>
<table>
@juniorbird
juniorbird / .bash_profile
Last active December 28, 2020 19:20
My setup process for a new machine
# What is the name of the machine I'm working on?
export MYMACHINENAME="Laptop"
# What color should I write this name in the prompt?
export MYMACHINECOLOR="38;5;36m"
# What color should I use for tmux?
export MYMACHINETMUX="colour36"
# Personal or Work machine?
export MYMACHINETYPE="Work"
if [ -f ~/dotfiles/bashrc ]; then
@juniorbird
juniorbird / phoneregex.txt
Last active December 8, 2015 16:18
Regex to match all common US phone number formats
(?:1[\-\s])?(?:\(?(\d{3})[\-\)\s]?(?:[\s\.])?)?\d{3}[-\s\.]\d{4}
@juniorbird
juniorbird / main.js
Last active January 16, 2016 07:16
JSON parser (objects are broken)
/* --------------------------------------------------------------------------- */
// Utility Functions
function dequote(str) {
// We need to remove excess quotes
// This seems hacky but I've run through a bunch of test cases and it appears to be what's needed
var newstring;
// Replace any escaped quotes
newstring = str.replace(/\\"/g, '"');
// The whole string will be wrapped in quotes. Unwrap.
@juniorbird
juniorbird / jsperfs.md
Last active March 9, 2016 18:05
All my JSPerfs

My JSPerfs

Sometimes, I want to know what's fast. Usually I google it. But, in the below cases, I decided I needed to try it myself.

  • Fastest Factorial - what's the cost of doing it recursively? Turns out While is 10x faster.
  • Fastest way to find type - instanceof seems good. JQuery uses constructor. Prototype.toString is probably the most safe and compatible.
  • Speed of Sorts, when written as recursive or using a while loop.