Skip to content

Instantly share code, notes, and snippets.

View apas's full-sized avatar

apas apas

View GitHub Profile
@apas
apas / netflix-genre-crawl.py
Created January 23, 2016 12:57 — forked from blech/netflix-genre-crawl.py
Fetch genre names from Netflix
#!/usr/bin/python
# TODO make range command line arguments
import sys, codecs
sys.stdout = codecs.getwriter('utf-8')(sys.stdout) # if your terminal can't do utf-8, well...
import time
import urllib2
import BeautifulSoup
@apas
apas / Makefile
Created March 11, 2016 12:37 — forked from fasiha/Makefile
A pandoc custom writer targeting tufte-css HTML
test.html: test.md tufte-css.lua html5.html
pandoc -t tufte-css.lua -f markdown -c tufte.css --template html5.html test.md > test.html
html5.html:
pandoc -D html5 > html5.html
@apas
apas / tables.py
Last active March 12, 2016 09:01
adds custom table class support for exported table HTML element in line #57 for tufte.css (pwd: env/lib/python2.7/site-packages/markdown/extensions)
"""
Tables Extension for Python-Markdown
====================================
Added parsing of tables to Python-Markdown.
See <https://pythonhosted.org/Markdown/extensions/tables.html>
for documentation.
Original code Copyright 2009 [Waylan Limberg](http://achinghead.com)
@apas
apas / deploy.sh
Last active March 12, 2016 10:48
Automate athena deploys.
deploy() {
python athena.py build
cd build/ && git add . && git commit -m "athena deployment job" && git push origin master && cd -
}
@apas
apas / Markdown to PDF.sublime-build
Created May 30, 2016 15:19
Markdown to PDF Sublime Text Build System
{
"cmd": ["mdtopdf", "$file_name"],
"selector": "text.html.markdown",
"path": "/usr/local/bin/:$PATH"
}
@apas
apas / footnotes.py
Last active June 1, 2016 18:27
footnotes extension Python Markdown
"""
Footnotes Extension for Python-Markdown
=======================================
Adds footnote handling to Python-Markdown.
See <https://pythonhosted.org/Markdown/extensions/footnotes.html>
for documentation.
Copyright The Python Markdown Project
openssl rand -hex 6 | sed 's/\(..\)/\1:/g; s/.$//' | xargs sudo ifconfig en0 ether
@apas
apas / ps1.sh
Last active November 6, 2016 04:31
minimal and elegant git aware shell prompt
# download jimeh's git-aware-prompt
# https://github.com/jimeh/git-aware-prompt
export GITAWAREPROMPT=~/.gap/git-aware-prompt
source $GITAWAREPROMPT/main.sh
# change your PS1 accordingly
# that'd normally print: `~ $`
# and in a git repo w/o changes: `/path/to/repo(branch-name) $`
# in git w/ changes: `/path/to/repo(branch-name)* $`
# (the asterisk is in red)
@apas
apas / gifcat.sh
Last active November 6, 2016 21:41
use boom and imgcat for a reaction-gif-archive in your terminal
# make sure you're using iTerm 2
#
# download + install imgcat
# https://raw.githubusercontent.com/gnachman/iTerm2/master/tests/imgcat
# (put it in your path and `chmod +x` it)
#
# install @holman's boom
# https://github.com/holman/boom
# $ gem install boom