Skip to content

Instantly share code, notes, and snippets.

View aaronjgreenberg's full-sized avatar

Aaron Greenberg aaronjgreenberg

View GitHub Profile
@aaronjgreenberg
aaronjgreenberg / gist:6395942
Created August 31, 2013 02:47
How I completely delete a program from my Mac.

Gotta have some guts to do this one, but:

find / 2>/dev/null | grep -i Silverlight | sudo xargs rm -rf
@aaronjgreenberg
aaronjgreenberg / libgit2-linking.md
Last active December 21, 2015 08:19
How to link libgit2, so I remember for later.

Assuming you've successfully built libgit2...

$ ls -l
drwxr-xr-x ... libgit2
-rw-r--r-- ... test.c
$
$ gcc -I ./libgit2/include -L ./libgit2/build -l git2 -o test test.c
@aaronjgreenberg
aaronjgreenberg / terminal-notifier.py
Last active December 16, 2015 05:08
Send Mac OS X Notifications using Python and terminal-notifier.
notifier_args = [
'terminal-notifier',
'-title',
'S3 Upload',
'-message',
'Copied to clipboard!'
]
subprocess.check_call(notifier_args)
@aaronjgreenberg
aaronjgreenberg / s3_uploader.py
Last active December 16, 2015 04:49
Uploads a file to your Amazon S3 bucket and then copies the access URL to your clipboard.
import sys
import os.path
import subprocess
import boto
filename = sys.argv[1]
basename = os.path.basename(filename)
base_url = 'http://<bucket-name>.s3.amazonaws.com'
@aaronjgreenberg
aaronjgreenberg / mongoff.sh
Created February 2, 2013 02:33
Shell command to stop a `mongod` process.
MONGO_PID=`ps aux | grep mongo | awk '{print $2}' | head -n 1`
# SIGTERM the mongod process
kill -15 $MONGO_PID
@aaronjgreenberg
aaronjgreenberg / quine.py
Created August 24, 2012 16:16
Writing Quines
#!/usr/bin/env python
# This program prints out its own source code
# ===========================================
import sys
def quine(filename):
f = open(filename, 'r')
for line in f.readlines():
print line.strip('\n')
@aaronjgreenberg
aaronjgreenberg / Makefile
Created July 17, 2012 23:36
Making It Rain
it:
@echo "、ヽ`ヽ`、ヽ``、ヽ`、ヽ`ヽ`、、ヽ`ヽ`、ヽ``、ヽ`、ヽ`ヽ`、、ヽ`ヽ`、ヽ``、ヽ"
@echo "`、ヽ`ヽ`、、ヽ`ヽ`、ヽマッテェ(ノ;Д;)ノ `、、ヽ`☂ヽ`、ヽ``、ヽ`、ヽ`ヽ`、、ヽ`ヽ"
rain:
@echo "`、ヽ``、ヽ`、ヽ`ヽ`、、ヽ`ヽ`、ヽ``、ヽ`、ヽ`ヽ`、、ヽ、ヽ`ヽ`、ヽ``"
@aaronjgreenberg
aaronjgreenberg / Makefile
Created July 17, 2012 23:25
Making Sandwiches
me:
@echo " _.---._"
@echo " _.-~ ~-._"
@echo " _.-~ ~-._"
@echo " _.-~ ~---._"
@echo " _.-~ ~\\"
@echo " .-~ _.;"
a:
@echo " :-._ _.-~ ./"