Skip to content

Instantly share code, notes, and snippets.

View adamlutz's full-sized avatar

Adam Lutz adamlutz

View GitHub Profile
@adamlutz
adamlutz / gist:3e2641787b1de29e2288
Last active November 28, 2023 12:08
stripe test payment cheatsheet
Valid Cards
4242424242424242 Visa
4012888888881881 Visa
5555555555554444 MasterCard
5105105105105100 MasterCard
378282246310005 American Express
371449635398431 American Express
6011111111111117 Discover
6011000990139424 Discover
30569309025904 Diner's Club
# 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="$HOME/.oh-my-zsh"
# Set name of the theme to load --- if set to "random", it will
# load a random theme each time oh-my-zsh is loaded, in which case,
# to know which specific one was loaded, run: echo $RANDOM_THEME
# See https://github.com/ohmyzsh/ohmyzsh/wiki/Themes
@adamlutz
adamlutz / gist:443ce5eef0df99a909caf0596257b9d0
Created October 5, 2023 02:04
postrgres.app pg bundler config fix
bundle config build.pg --with-pg-config=/Applications/Postgres.app/Contents/Versions/latest/bin/pg_config
@adamlutz
adamlutz / prompt.fish
Last active January 23, 2021 17:35
git fish prompt
# use custom function instead of fish built in git prompt due to performance
# (fish git prompt uses diff which can be slow)
function git_prompt
# uses simple grep and colrm instead of complicated sed regex
set -l branch (git branch 2> /dev/null | grep --color=never -e '*.\(.*\)' | colrm 1 2)
# use git status to improve performance (instead of using diff)
# [MADRC] - if file is modified
# ? - if untracked file exists
set -l git_dirty (git status -s | colrm 3 | colrm 1 1 | grep --color=never -e '[MADRC]')
@adamlutz
adamlutz / config.fish
Last active January 23, 2021 17:35
config.fish (git)
set -x PATH /opt/homebrew/bin $PATH
set -x PATH /usr/local/bin $PATH
set -x PATH /usr/local/sbin $PATH
set -x PATH ~/bin $PATH
set -x PATH /Applications/Postgres.app/Contents/Versions/latest/bin $PATH
set PATH $HOME/.rbenv/shims $PATH
set PATH $HOME/.rbenv/bin:$PATH
rbenv rehash >/dev/null ^&1
status --is-interactive; and source (rbenv init -|psub)
@adamlutz
adamlutz / config.fish
Last active February 24, 2017 01:32
~/.config/fish/config.fish
set PATH $HOME/.rbenv/shims $PATH
rbenv rehash >/dev/null ^&1
status --is-interactive; and source (rbenv init -|psub)
set -x PATH /usr/local/bin $PATH
set -x PATH /usr/local/sbin $PATH
set -x PATH ~/bin $PATH
set -x PATH /Applications/Postgres.app/Contents/Versions/latest/bin $PATH
$ defaults write com.apple.finder AppleShowAllFiles -bool true
@adamlutz
adamlutz / mechanized_search.rb
Last active June 2, 2016 18:27
mechanized cancer.gov search
require 'rubygems'
require 'ruby-progressbar'
require 'mechanize'
require 'pry'
require 'csv'
agent = Mechanize.new { |agent|
agent.user_agent_alias = 'Mac Safari'
}
@adamlutz
adamlutz / postgres rails config fix
Last active May 15, 2016 18:22
postgres rails config fix for postgres.app
gem install pg -v '0.18.4' -- --with-pg-config=/Applications/Postgres.app/Contents/Versions/latest/bin/pg_config
@adamlutz
adamlutz / gist:87754551ba05dba5a31e
Created October 12, 2015 14:52
rails vagrant postgres scotchbox
Clone Scotch Box git@github.com:scotch-io/scotch-box.git
Clone project into public
ssh into server install
sudo apt-get install libpq-dev
go into psql
sudo -u postgres psql
create vagrant user
CREATE USER vagrant WITH SUPERUSER;
bind rails server to scotchbox ip
rails server -b 192.168.33.10