Script Editor

This is a reminder for myself more than anything.

To learn what you can do with an application using osascript, you can run Script Editor and click “Open the Application’s Dictionary” to see properties &/methods that are available.

git survey

Some of the commands in the survey looks interesting, must find time to learn them.

git add -i / -p
git add -u / -A
git am
git am -i
git apply
git apply --whitespace=fix
git archive
git bisect
git bisect run 
git annotate
git gui blame
git blame
git blame -L , etc.
git bundle
git cherry
git cherry-pick
git cherry-pick -n
git citool
git clean
git add + git commit
git commit -a
git commit ...
git commit -i ...
git commit --amend
git cvsexportcommit
git cvsserver
git daemon
git daemon (pushing enabled)
git ... --dirstat
git fetch []
git filter-branch
git format-patch
git grep
git imap-send
git instaweb
git log --grep/--author/...
git log -S (pickaxe search)
git log --graph
git merge
git merge with strategy
git merge --squash
git mergetool
git pull (no remote)
git pull --rebase []
git pull 
git pull 
git push
git relink
git rebase
git rebase -i
git remote
git remote update
git request-pull
git revert
git send-email
git show-branch
git shortlog
git shortlog -s
git stash
git stash --keep-index
git submodule
git svn
git whatchanged
git gui
gitk

Jar decompiler

A while ago I posted some shell scripts to decompile java classes.

I decided to re-implement it in ruby so I can use it between my work (Windows) and home (OS X) machines.

This version does not require you to extract the class files first. You simply pass the jar file to the script and it’ll decompress and decompile it into a directory with the same name as the jar file without .jar.

How to map a network drive

net use x: \\{server}\d$  /USER:{server}\{username} {password}

Basically says you want to map d: drive on {server} to your x: drive as the {username}, which is a login locally on {server}

How to decompile everything

Quick script to decompile all the class files.

find . -name "*.class" -not -name "*\$*" | while read class
do
  dir=`dirname $class`
  file=`basename $class .class`
  pushd $dir >/dev/null
  jad -p ${file}.class > ${file}.java
  popd >/dev/null
done