Skip to content

Instantly share code, notes, and snippets.

@gcamp806
gcamp806 / debian:.bash_profile
Last active September 5, 2017 13:57
for certain debian versions (e.g. the version used by DreamHost)
# ~/.bash_profile: executed by bash(1) for login shells.
# below lines are added to the end of .bashrc
#__prompt_command ()
#{
# local pwd='~';
# [ "$PWD" != "$HOME" ] && pwd=${PWD/#$HOME\//\~\/};
# printf "\033]0;%s@%s: %s\007" "${USER}" "${HOSTNAME%%.*}" "${pwd}"
#}
#
@gcamp806
gcamp806 / crontab.sh
Created May 20, 2013 13:47
crontab example
MAILTO='user@domain.com'
#
# To define the time you can provide concrete values for
# minute (m), hour (h), day of month (dom), month (mon),
# and day of week (dow) or use '*' in these fields (for 'any').#
# Notice that tasks will be started based on the cron's system
# daemon's notion of time and timezones.
#
# Output of the crontab jobs (including errors) is sent through
# email to the user the crontab file belongs to (unless redirected).
@gcamp806
gcamp806 / .vimrc
Created March 22, 2016 14:29
.vimrc
" URL: http://vim.wikia.com/wiki/Example_vimrc
" Authors: http://vim.wikia.com/wiki/Vim_on_Freenode
" Description: A minimal, but feature rich, example .vimrc. If you are a
" newbie, basing your first .vimrc on this file is a good choice.
" If you're a more advanced user, building your own .vimrc based
" on this file is still a good idea.
"------------------------------------------------------------
" Features {{{1
"
@gcamp806
gcamp806 / .emacs
Created March 22, 2016 14:30
.emacs
(setq load-path (append load-path (list "~/elisp")))
(setq inhibit-splash-screen t)
;; Turn on mouse wheel
;;(mouse-wheel-mode t)
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
#!/bin/bash
function __prompt
{
# List of color variables that bash can use
local BLACK="\[\033[0;30m\]" # Black
local DGREY="\[\033[1;30m\]" # Dark Gray
local RED="\[\033[0;31m\]" # Red
local LRED="\[\033[1;31m\]" # Light Red
local GREEN="\[\033[0;32m\]" # Green
# ~/.bash_profile: executed by bash(1) for login shells.
alias ls='ls -G'
alias ll='ls -l'
alias df='df -h'
alias e='_(){ emacs $@ & }; _'
alias em='emacs -nw'
alias es='esql'
alias p='prod_db'
@gcamp806
gcamp806 / sync_forked_repo.md
Last active September 8, 2017 19:59
Keep your forked repo up-to-date

How to sync a forked repo with the upstream repo

After forking a repo, often you will want to keep it in sync with the upstream master repo. Here are the steps you can follow to accomplish that.

1. Clone your fork

git clone git@github.com:YOUR_USERNAME/REPO_NAME.git

2. Add a remote from the upstream (original) repo in your local forked repo

cd REPO_NAME

Keybase proof

I hereby claim:

  • I am gcamp806 on github.
  • I am gcamp (https://keybase.io/gcamp) on keybase.
  • I have a public key ASBt8kErW3itXaSJjU4GGATTTY25OwBJYYG27zvn0FMFCwo

To claim this, I am signing this object:

@gcamp806
gcamp806 / homebrew_install_macOS.txt
Last active April 10, 2020 01:35
Homebrew install on macOS
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install libdvdcss
**PRELIMINARY**
// Install Xcode Tools: xcode-select --install
// Install Homebrew: ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
**CASK**
//Install Cask brew install cask
@gcamp806
gcamp806 / .bash_gcamp
Last active May 9, 2018 14:21
My custom bashrc script
#!/bin/bash
# Greg's custom bash stuff
# Executed by ~/.bashrc, e.g. source ~/.bash_gcamp
###export EDITOR='sublime'
# prompt helper functions
function parse_git_dirty
{
if [ -d .git ] || git rev-parse --git-dir > /dev/null 2>&1; then
#[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit, working directory clean" ]] && echo "✘ " || echo "✔ "