Skip to content

Instantly share code, notes, and snippets.

😒🙅🙄
$thing for fun and profit
all your $thing are belong to $shutup
honey I $verbed the $thing
$thing demystified
$thing: a deep dive
$verb all the things
make $thing great again
$x and $y and $z, oh my!
To try out the Voltron disassembly view syntax highlighting:
$ pip install pygments-style-solarized
Check out ToT Voltron and reinstall it:
$ cd voltron
$ git pull
$ sudo python setup.py install
@snare
snare / pypath.zsh
Last active May 10, 2016 01:53
Print the path to an installed Python library
# useful for $ subl `pyfile $mod`
pypath() {
PY=$(python -c "import $1; print($1.__file__)"|sed 's/pyc/py/')
if [ $(basename "$PY") != "__init__.py" ]
then
echo $PY
else
echo $(dirname "$PY")
fi
import sys
sys.path = [p for p in sys.path if 'Cellar' not in p]
new_path = ['/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages',
'/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python',
'/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk',
@snare
snare / Example.sublime-project
Last active March 15, 2016 04:40
Sublime Text project settings to enable building and running Xcode projects. Default build function is to build debug, but includes variants for building release and running both debug and release builds. Just modify the path to your xcodeproj and you're all set.
{
"folders": [
{
"follow_symlinks": true,
"path": "."
}
],
"build_systems": [
{
"name": "Xcode Build",
# kwarg/object style
env = Environment(
# config/main environment directory
dir=Directory('~/.myproject', children=[
# config file within that directory, defaults loaded from a file
# inside the package
ConfigFile('config', default=PackageFile('config/default.cfg'))
# user plugin directory, plugins loaded automatically
PluginDirectory('plugins')
"""
Example command plugin
Copy this to your ~/.voltron/plugins directory. It will be loaded when
Voltron is initialised, and register a debugger command that works as follows:
$ lldb /tmp/inferior
Voltron loaded.
Run `voltron init` after you load a target.
(lldb) target create "/tmp/inferior"
"""
Example command plugin
Copy this to your ~/.voltron/plugins directory. It will be loaded when
Voltron is initialised, and register a debugger command that works as follows:
$ lldb /tmp/inferior
Voltron loaded.
Run `voltron init` after you load a target.
(lldb) target create "/tmp/inferior"
@snare
snare / dead
Last active August 29, 2015 13:56
import subprocess
import sys
import random
def main():
args = sys.argv[1:]
output = subprocess.check_output(['head'] + args)
lines = output.splitlines()
idx = random.randint(0, len(lines))
lines[idx] = "Fuck off, happy jerks."
@snare
snare / .gitignore
Created January 29, 2014 06:04 — forked from adamgit/.gitignore
#########################
# .gitignore file for Xcode4 / OS X Source projects
#
# Version 2.0
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# 2013 updates:
# - fixed the broken "save personal Schemes"
#
# NB: if you are storing "built" products, this WILL NOT WORK,