Skip to content

Instantly share code, notes, and snippets.

@patmood
patmood / .vimrc
Created February 6, 2014 17:34
.vimrc Feb 6th 2014
syntax on
filetype off
set hlsearch
" Remove trailing whitespace on save
autocmd BufWritePre * :%s/\s\+$//e
" add mouse scrolling
set mouse=a
map <ScrollWheelUp> <C-Y>
@patmood
patmood / clean_branches.md
Last active August 29, 2015 13:57
Delete all merged branches from a repo

Clean up old git branches

This will delete branches that have already been merged. Good for cleaning up local repos. Wont delete your current branch.

git branch --merged | grep -v "\*" | xargs -n 1 git branch -d

Saved here for my own reference but all credit to this guy: http://stevenharman.net/git-clean-delete-already-merged-branches

WARNING: This will only spare your current branch. Remember that you might lose master/staging/etc if you're not currently on that branch.

@patmood
patmood / tmux_reference
Last active August 29, 2015 14:00
tmux cheat sheet
Split vertically: <Ctrl-b>%
Split horizontally: <Ctrl-b>"
Move around panes: <Ctrl-b>[Up, Down, Right, Left]
Previous pane: <Ctrl-b>;
Rotate panes: <Ctrl-b><Ctrl-o>
Resize: <Ctrl-b>:resize-pane -U[D,L,R] 10
Close pane: <Ctrl-b>x

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@patmood
patmood / regex.js
Last active August 29, 2015 14:03
Javascript Email validation regex
var string = si_eg-h+esg34576457s@slei.ghsegse.lsi.ehg.com
string.match(/^(\w|\+|\d|\-|\.)+\@(\w|\d|\-)+\.(\w|\.)+$/i)
@patmood
patmood / ANSI-color-codes.txt
Created November 11, 2015 05:51
Atom Snippets
TP_ANSI_RESET "\x1b[0m"
TP_ANSI_BOLD_ON "\x1b[1m"
TP_ANSI_INVERSE_ON "\x1b[7m"
TP_ANSI_BOLD_OFF "\x1b[22m"
TP_ANSI_FG_BLACK "\x1b[30m"
TP_ANSI_FG_RED "\x1b[31m"
TP_ANSI_FG_GREEN "\x1b[32m"
TP_ANSI_FG_YELLOW "\x1b[33m"
TP_ANSI_FG_BLUE "\x1b[34m"
TP_ANSI_FG_MAGENTA "\x1b[35m"

Instructions:

  1. Download this application skeleton.
  2. Convert the app to use AJAX.
  3. Add any files you changed to your gist and submit your code.
/* Here is your chance to take over Socrates!
Spend 10 minutes on each of the following hacks to the socrates website.
Enter them in the console to make sure it works and then save
your results here.
Choose a new pair for each. Add your names to the section you complete.
*/
@patmood
patmood / zoo.js
Last active December 19, 2015 07:19 — forked from dbc-challenges/zoo.js
//------------------------------------------------------------------------------------------------------------------
// YOUR CODE: Create your Zoo "object literal" and Animal "constructor" and "prototypes" here.
//------------------------------------------------------------------------------------------------------------------
var Zoo = {
animals: [],
init: function(x){
this.animals = x;
},
bipeds: function(){
@patmood
patmood / index.html
Last active December 19, 2015 07:19 — forked from dbc-challenges/index.html
DBC Phase 2 Practice Assessment Part 3
<!doctype html>
<html>
<head>
<link rel="stylesheet" href="http://cdn.jsdelivr.net/normalize/2.1.0/normalize.css">
<link rel="stylesheet" href="main.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700,800">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=Lato:100,900">
<link rel="stylesheet" href="http://cdnjs.cloudflare.com/ajax/libs/font-awesome/3.0.2/css/font-awesome.min.css">
</head>