Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+C | copy current line (if no selection) |
Ctrl+X | cut current line (if no selection) |
Ctrl+⇧+K | delete line |
Ctrl+↩ | insert line after |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Return the number of days between today, and the input date | |
Also calculate how many times the month rolls over | |
The expected format is dd/mm/yyyy | |
There's no input or bounds checking hahahahahahahaha | |
""" | |
import datetime |
% Biblatex-MLA setup for Biblatex-MLA 0.9.5 | |
\usepackage[ | |
style=mla, | |
autocite=footnote, | |
backref=true, | |
hyperref=true, | |
backend=biber]{biblatex} | |
% Compatibility fixes for Biblatex 2.0 and Biblatex-MLA | |
\DeclareAutoCiteCommand{footnote}[f]{\footcite}{\footcites} | |
\providecommand\biburldatelong{} |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
from bs4 import BeautifulSoup | |
import requests | |
gh_url = "https://github.com/blog/%s" | |
titles = [] | |
# all posts since the 19th of May 2011 | |
for r in xrange(858, 1395): |
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+C | copy current line (if no selection) |
Ctrl+X | cut current line (if no selection) |
Ctrl+⇧+K | delete line |
Ctrl+↩ | insert line after |
#!/bin/bash -e | |
# opinionated Flask bootstrap script | |
# assumes you'll be using MySQL/PG, Fabric, Webassets, WTForms and Blueprints | |
# creates a virtualenv and an Alembic migrations system | |
# The script will halt on any error, and remove the project dir, if it created one | |
# accepts a single argument: a new directory name under which to create the project | |
# check that Python is installed | |
type python >/dev/null 2>&1 || { echo >&2 "Python doesn't appear to be installed. Aborting."; exit 1; } |
#!/usr/bin/env python | |
def wrap(f): | |
def enc(*args): | |
for item in args: | |
f(item) | |
return enc | |
@wrap |
[u'<div class="csl-entry">Sontag, S. \u201cGodot Comes to Sarajevo.\u201d <i>The New York Review of Books</i> 21 (1993) : 53\u201359. Print.</div>', | |
u'<div class="csl-entry">McIntyre, T. J. \u201cCopyright in Custom Code: Who Owns Commissioned Software?\u201d <i>Journal of Intellectual Property Law & Practice</i> (2007) : n. pag. Print.</div>', | |
u'<div class="csl-entry">Badiou, A. \u201c\u2018We Need a Popular Discipline\u2019: Contemporary Politics and the Crisis of the Negative.\u201d <i>Critical Inquiry</i> 34.4 (2008) : n. pag. Print.</div>'] |
If you have installed MacGPG2 via the package installer, several other | |
checks in this script will turn up problems, such as stray .dylibs in | |
/usr/local and permissions issues with share and man in /usr/local/. | |
Some "config" scripts were found in your path, but not in system or Homebrew folders. | |
`./configure` scripts often look for *-config scripts to determine if software packages | |
are installed, and what additional flags to use when compiling and linking. | |
Having additional scripts in your path can confuse software installed via Homebrew if |
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
""" | |
Assume a target number and an actual number | |
Assume a range of commission payments based upon the percentage achieved | |
What is the amount of commission due? | |
""" | |
from decimal import Decimal |
#!/usr/bin/env python | |
def fibo(): | |
""" | |
yield the Fibonacci sequence | |
""" | |
a, b = 0, 1 | |
while True: | |
yield a | |
a, b = b, a + b |