Skip to content

Instantly share code, notes, and snippets.

View johnelm's full-sized avatar
💭
I may be slow to respond.

John Elm johnelm

💭
I may be slow to respond.
View GitHub Profile
@johnelm
johnelm / ArchiveandLogDone.scpt
Created July 18, 2012 02:13 — forked from mreidsma/ArchiveandLogDone.scpt
Applescript to archive completed Taskpaper tasks to Google Calendar with ifttt.com
-- Archive completed Taskpaper tasks to Google Calendar with ifttt.com
-- First, set up the following recipe at ifttt.com to add completed tasks to your calendar:
-- http://ifttt.com/recipes/30256
--
-- Then use this Applescript to archive tasks. Mail.app needs to have the default account match your ifttt.com email
-- Let me know if you have any questions: reidsmam@gvsu.edu or @mreidsma
set archivedTasks to ""
@johnelm
johnelm / git
Created September 10, 2016 07:48
git tips
git diff : compare current with staged (or with last commit if no staged one)
git diff —staged : compare staged with last commit
git diff <master>…<topicbr> : show diff introduced by topicbr comparing to master (base commit in master)
git diff <sha-1> : show diff betwheen latest commit of current branch and other commit (sha-1)
git log -n : view last n commits
git log -n -p : last n commits with summary of changes (diff)
git log -n —graph : graphical view branch history
git log —pretty=oneline : each commit at one line
git log <br1> —not <br2> : list commits which are in br1 but not in br2
@johnelm
johnelm / git-cheat-sheet.md
Created September 10, 2016 07:48 — forked from iansheridan/git-cheat-sheet.md
A cheat sheet for GIT

Setup

git clone <repo>

clone the repository specified by ; this is similar to "checkout" in some other version control systems such as Subversion and CVS

Add colors to your ~/.gitconfig file:

@johnelm
johnelm / current-dir-in-iterm-tab-title.sh
Created March 11, 2018 00:59 — forked from phette23/current-dir-in-iterm-tab-title.sh
Set the iTerm tab title to the current directory, not full path.
# put this in your .bash_profile
if [ $ITERM_SESSION_ID ]; then
export PROMPT_COMMAND='echo -ne "\033];${PWD##*/}\007"; ':"$PROMPT_COMMAND";
fi
# Piece-by-Piece Explanation:
# the if condition makes sure we only screw with $PROMPT_COMMAND if we're in an iTerm environment
# iTerm happens to give each session a unique $ITERM_SESSION_ID we can use, $ITERM_PROFILE is an option too
# the $PROMPT_COMMAND environment variable is executed every time a command is run
# see: ss64.com/bash/syntax-prompt.html