Skip to content

Instantly share code, notes, and snippets.

View jameswomack's full-sized avatar
📈

James J. Womack jameswomack

📈
View GitHub Profile
@jameswomack
jameswomack / path.sh
Created October 1, 2012 15:33
Trying to get a simple add/remove PATH script going
path()
{
_path=$1
_r=$2
_pathLength=${#_path}
_PATHH=""
if [ $_pathLength -gt '0' ]; then
if [ "$_r" = "r" ]
then
@jameswomack
jameswomack / fuck_stick.js
Created November 5, 2012 20:16
Fucksticks
Running test suite. 24 files required.
.......................{ options:
{ data: { view: 'parents', key: '["grade",10]', include_docs: true },
type: 'json',
url: 'http://localhost:3000/api/px/_design/app/_view/parents',
method: 'GET',
autosend: false },
subject:
{ [Function: Grade]
__super__:
@jameswomack
jameswomack / UIGestureRecognizerInternals.m
Last active December 12, 2015 03:58
UIGestureRecognizerInternals.m
//
// ABAppDelegate.m
// DualDisplayExample
//
// Created by James Womack on 1/30/13.
// Copyright (c) 2013 James Womack. All rights reserved.
//
#import "ABAppDelegate.h"
#import "ABTeacherViewController.h"
@jameswomack
jameswomack / chmod_passenger_directories.sh
Last active December 14, 2015 07:29 — forked from smathy/gzip.conf
Setup for AO
# http://trac.nginx.org/nginx/ticket/94
brew uninstall pcre
mkdir -p ~/Documents/src/pcre_previous
sudo mv /usr/local/lib/libpcre* ~/Documents/src/pcre_previous
gem install passenger
@jameswomack
jameswomack / nginx_install_preparation.sh
Created March 25, 2013 20:02
Safely re-installing Phusion Passenger w/ Nginx
mk dir ~/opt_nginx_backup_250320131259/
cp -R /opt/nginx/* ~/opt_nginx_backup_250320131259
@jameswomack
jameswomack / uninstall_xcode_command_line_tools.sh
Created April 8, 2013 21:45
Uninstall Xcode Command Line Tools (add to your Bash or ZSH profile)
xcrm()
{
RECEIPT_FILE=/var/db/receipts/com.apple.pkg.DeveloperToolsCLI.bom
RECEIPT_PLIST=/var/db/receipts/com.apple.pkg.DeveloperToolsCLI.plist
if [ ! -f "$RECEIPT_FILE" ]
then
echo "Command Line Tools not installed."
exit 1
fi
@jameswomack
jameswomack / iptables
Created April 11, 2013 05:21
`sudo iptables` -L output
Chain INPUT (policy DROP)
target prot opt source destination
ufw-before-logging-input all -- anywhere anywhere
ufw-before-input all -- anywhere anywhere
ufw-after-input all -- anywhere anywhere
ufw-after-logging-input all -- anywhere anywhere
ufw-reject-input all -- anywhere anywhere
ufw-track-input all -- anywhere anywhere
Chain FORWARD (policy DROP)
@jameswomack
jameswomack / .zshrc
Created April 19, 2013 04:39
Uninstall all non-default gems. Works with Ruby 2.
source ~/uninstall_ruby_2_gems.zsh
alias rgu='sudo rgu'
@jameswomack
jameswomack / reload_show.vim
Created April 19, 2013 05:20
Reload or show path to your vimrc without leaving vim
:source $MYVIMRC "reload vimrc
:echo $MYVIMRC "show vimrc path
@jameswomack
jameswomack / make_it_a_year.js
Created April 27, 2013 05:08
Add "1 year" to Github Pulse period drop-down menu
select_menu_list = $('.js-pulse-period').first()
yearly_item = select_menu_list.find('.js-navigation-item').last().clone()
select_menu_list.find('.select-menu-list').first().append(yearly_item)
yearly_item.removeClass('navigation-focus')
yearly_item.find('.js-select-button-text').text('1 year')
yearly_item_input = yearly_item.find('input').first()
yearly_item_data_url = yearly_item_input.attr('data-url')