Skip to content

Instantly share code, notes, and snippets.

Avatar

Derek Mullins drkmullins

View GitHub Profile
@drkmullins
drkmullins / gitCleanup
Created Mar 13, 2017
Deletes local branches that no longer exist on the remote
View gitCleanup
git fetch -p && git branch -vv | gawk "/: gone]/{print $1}" | xargs git branch -d
@drkmullins
drkmullins / findJar
Created Jul 25, 2013
This will find a given class name's jar
View findJar
find / -type f -name '*.jar' -exec grep -l '[ClassName].class' '{}' \;
View NotificationSpy
NSNotificationCenter *center;
center = [NSNotificationCenter defaultCenter];
token = [center addObserverForName: nil
object: nil
queue: nil
usingBlock: ^(NSNotification *notification) {
QuietLog (@"NOTIFICATION %@ -> %@",
notification.name, notification.userInfo);
}];
@drkmullins
drkmullins / autoWireless.sh
Last active Dec 16, 2015
Checks my macbook's Wi-Fi every 5 seconds. If it's down, it restarts the adapter. I use it when my Wi-Fi signal is flaky and my macbook is having issues staying connected.
View autoWireless.sh
#!/bin/bash
# Checks my mac's Wi-Fi every 5 seconds.
# If it's down, restart the adapter.
while :
do
if [ $(networksetup -getinfo Wi-Fi | grep -c 'IP address:') = '1' ]
then
$(networksetup -setairportpower en1 off)