Skip to content

Instantly share code, notes, and snippets.

View jeremyjbowers's full-sized avatar

Jeremy Bowers jeremyjbowers

View GitHub Profile
user www-data;
worker_processes 1;
error_log /opt/log/nginx.log;
pid /opt/run/nginx.pid;
events {
worker_connections 1024;
use epoll;
}
http {
user www-data;
worker_processes 1;
error_log /opt/log/nginx.log;
pid /opt/run/nginx.pid;
events {
worker_connections 1024;
use epoll;
}
http {
@jeremyjbowers
jeremyjbowers / brotatoes.txt
Created October 10, 2011 11:58 — forked from ryanpitts/brotatoes.txt
Weekend potato recipe
Weekend potatoes (or Brotatoes, to annoy teenage sons)
Yep, when you break it down, these are pretty simple. But they taste
good like crack late on a Sunday morning.
-----------
INGREDIENTS
-----------
- a big-ass skillet (I use a 15-inch nonstick. Cast iron would be great.
@jeremyjbowers
jeremyjbowers / awesome.js
Created October 31, 2011 14:29 — forked from drinks/awesome.js
Better AutoAwesome
var loveit = function(){var e,el,interval=Math.random()*60000;e = new jQuery.Event("click");e.pageX=1;e.pageY=1;el = jQuery('.record_pile:last').nextAll('a').eq(2);turntable.lastMotionTime=new Date().getTime();el.hover().trigger(e);setTimeout(loveit, interval);};loveit();
@jeremyjbowers
jeremyjbowers / nltk_tokenize_tag_chunk.rst
Created February 25, 2012 17:41 — forked from japerk/nltk_tokenize_tag_chunk.rst
NLTK Tokenization, Tagging, Chunking, Treebank

Sentence Tokenization

>>> from nltk import tokenize
>>> para = "Hello. My name is Jacob. Today you'll be learning NLTK."
>>> sents = tokenize.sent_tokenize(para)
>>> sents
['Hello.', 'My name is Jacob.', "Today you'll be learning NLTK."]
import urlparse
import oauth2 as oauth
consumer_key = ''
consumer_secret = ''
request_token_url = 'http://www.tumblr.com/oauth/request_token'
access_token_url = 'http://www.tumblr.com/oauth/access_token'
authorize_url = 'http://www.tumblr.com/oauth/authorize'
class ReloaderEventHandler(FileSystemEventHandler):
"""
Listen for changes to modules within the Django project
On change, reload the module in the Python Shell
Custom logic required to reload django models.py modules
Due to the singleton AppCache, which caches model references.
For those models files, we must clear and repopulate the AppCache
"""
def __init__(self, *args, **kwargs):

Where people struggle learning Django

Over the last 3 years or so I've helped a bunch of companies, small and large, switch to Django. As part of that, I've done a lot of teaching Django (and Python) to people new to the platform (and language). I'd estimate I've trained something around 200-250 people so far. These aren't people new to programming — indeed, almost all of them are were currently employed as software developers — but they were new to Python, or to Django, or to web development, or all three.

In doing so, I've observed some patterns about what works and what doesn't. Many (most) of the failings have been my own pedagogical failings, but as I've honed my coursework and my skill I'm seeing, time and again, certain ways that Django makes itself difficult to certain groups of users.

This document is my attempt at organizing some notes around what ways different groups struggle. It's not particularly actionable — I'm not making any arguments about what Django should or shouldn't do (at least

import re
import json
ws_re = re.compile("\s+")
line_num_re = re.compile("\s\d+\s{2,}", re.M)
# first, pdftotext -layout <pdf> <text>
with open("12-307_jnt1.txt", "r") as f:
data = f.read()
{
"bold_folder_labels": true,
"caret_style": "phase",
"close_windows_when_empty": true,
"color_scheme": "Packages/Theme - Flatland/Flatland Dark.tmTheme",
"draw_indent_guides": true,
"draw_white_space": "selection",
"file_exclude_patterns":
[
".DS_Store",