Skip to content

Instantly share code, notes, and snippets.

morganp /
Last active Oct 5, 2017
Matlab Tab competion for user functions
morganp /
Created Aug 7, 2017
Fixing OS X local permissions for successful back up and restore.

Remove local .DS_Store

find . -name '.DS_Store' -type f -delete

Remove file lock permissions (Perforce)

sudo chflags -R nouchg ~/Documents

Code plan has not restored correct user.

morganp /
Last active Jul 19, 2017
OS X Sierra Kindle book (azw) location
View downloads DRM'd books to this location

"~/Library/Containers/ Support/Kindle/My Kindle Content/"
morganp /
Created Mar 28, 2017
Notes On practicing Guitar


Justin Guitar


Use Metronome for equal not spacing. practice scale, then increase speed 5-20bpm.


morganp /
Last active Mar 27, 2017
Bash and (G/M)vim Tips

Bash: Backspace word ctrl-w
Vim Folding start {{{ end }}}
Vim Folding Open All zR
Vim Folding Close All zM
Vim list current Colorscheme echo g:colors_name

morganp / crontab
Created Oct 16, 2016
Crontab with rvm
View crontab
SHELL = /home/lounge/.rvm/bin/rvm-shell
# Minute Hour Day Month Day of Week Command
# (0-59) (0-23) (1-31) (1-12) (0-6)
0,15,30,45 * * * * /bin/bash -l -c 'cd /path/to/script && ./run_script’
morganp /
Created Sep 9, 2016
Get SMART disk info OS X
morganp /
Last active Sep 8, 2016
Lightweight spreadsheet for OS X

For KDE Home brew edit .bashrc

export KDEDIRS=$KDEDIRS:$HOME/Library/Preferences/KDE:/usr/local/kde4
export PATH=/usr/local/kde4/bin:$PATH
export DYLD_LIBRARY_PATH=/usr/local/kde4/lib:$DYLD_LIBRARY_PATH
launchctl setenv DYLD_LIBRARY_PATH /usr/local/kde4/lib:$DYLD_LIBRARY_PATH
export XDG_DATA_HOME=$HOME/Library/Preferences/KDE/share
export XDG_DATA_DIRS=/usr/local/kde4/share:/usr/local/share:/usr/share
morganp /
Created Sep 4, 2016
Change date on git commits
# commit
# date YYYY-mm-dd HH:MM:SS
# git cdc @~ "2014-07-04 20:32:45"
#Reset commit before HEAD
#commit="$1" datecal="$2"
#current_branch="$(git rev-parse --abbrev-ref HEAD)"
morganp /
Last active Sep 4, 2016
Script Transmission to remove torrent, and move data after specified time
#!/usr/bin/env bash
# Remove torrents from Transmission after a set number of days.
# Life cylce is: Incomplete -> Completed & Seeding -> Completed & removed for client
# In part based on:
# Turn Days into Seconds
REMOVE_AFTER=`expr $DAYS \* 24 \* 60 \* 60`