Skip to content

Instantly share code, notes, and snippets.

@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
@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}"
#}
#
# ~/.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
@gcamp806
gcamp806 / macOS-.bash_profile
Last active November 1, 2017 13:49
macOS-bash profile/rc scripts
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
@gcamp806
gcamp806 / Default (OSX).sublime-keymap -- User
Created November 13, 2017 16:37 — forked from mnme/Default (OSX).sublime-keymap -- User
Sublime Text 2 and 3: fix for OSX home/end keys, with selection support and command (super) key
{ "keys": ["home"], "command": "move_to", "args": {"to": "bol"} },
{ "keys": ["end"], "command": "move_to", "args": {"to": "eol"} },
{ "keys": ["shift+end"], "command": "move_to", "args": {"to": "eol", "extend": true} },
{ "keys": ["shift+home"], "command": "move_to", "args": {"to": "bol", "extend": true } },
{ "keys": ["super+end"], "command": "move_to", "args": {"to": "eof"} },
{ "keys": ["super+home"], "command": "move_to", "args": {"to": "bof"} },
{ "keys": ["super+shift+end"], "command": "move_to", "args": {"to": "eof", "extend": true} },
{ "keys": ["super+shift+home"], "command": "move_to", "args": {"to": "bof", "extend": true } },
@gcamp806
gcamp806 / cheatsheet.md
Created December 18, 2017 22:10
Terminal cheatsheet for macOS

Terminal Cheatsheet for Mac (Basics)


Letters are shown capitalized for readability only. Capslock should be off.

SHORTCUTS

Key/Command Description
Ctrl + A Go to the beginning of the line you are currently typing on. This also works for most text input fields system wide. Netbeans being one exception