Skip to content

Instantly share code, notes, and snippets.

View jefftriplett's full-sized avatar
Living the dream

Jeff Triplett jefftriplett

Living the dream
View GitHub Profile
@jefftriplett
jefftriplett / dev_middleware.py
Last active January 16, 2017 10:14
Both of these have saved me quite a bit of time. Only requirement is clint via `pip install clint`. `MIDDLEWARE_CLASSES += ['dev_middleware.SQLPrintingMiddleware', 'dev_middleware.ProfilerMiddleware',]
"""
Originaly code was taken from: http://djangosnippets.org/snippets/290/
But I was made some improvements like:
- print URL from what queries was
- don't show queries from static URLs (MEDIA_URL and STATIC_URL, also for /favicon.ico).
- If DEBUG is False tell to django to not use this middleware
- Remove guessing of terminal width (This breaks the rendered SQL)
"""
try:
import cProfile as profile

app running on iOS screenshot

app running on OS-X screenshot

app layout

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jefftriplett
jefftriplett / tor.py
Last active March 19, 2025 16:34
Python Requests + Tor (Socks5)
"""
setup:
pip install requests
pip install requests[socks]
super helpful:
- http://packetforger.wordpress.com/2013/08/27/pythons-requests-module-with-socks-support-requesocks/
- http://docs.python-requests.org/en/master/user/advanced/#proxies
"""
mkvirtualenv pythondotorg
workon pythondotorg
git clone (github url)
pip install -r pythondotorg/requirements.txt
add2virtualenv .
add2virtualenv pythondotorg
@jefftriplett
jefftriplett / fabric.coffee
Last active January 2, 2016 00:59
A really basic hubot fabric wrapper. Works for me but this is just the basics. Set an environment variable for `HUBOT_FABRIC_PATH` and try `fab help` or `fabric help` to get a list of commands.
# fab <command> - to manage fabric
{spawn, exec} = require 'child_process'
fabric_path = process.env.HUBOT_FABRIC_PATH
fabric_bin = "cd " + fabric_path + " && fab "
module.exports = (robot) ->
robot.respond /(fab|fabric) ?([\w .-]+)/i, (msg) ->
if msg.match[2] != undefined
if msg.match[2] == "help"
@jefftriplett
jefftriplett / feeds.csv
Created October 10, 2013 18:10
rss feed finder for open lawrence
We can make this file beautiful and searchable if this error is corrected: No commas found in this CSV file in line 0.
http://amyklamet.com/rss.php
http://archaeology.biodiversity.ku.edu/rss.xml
http://computation.llnl.gov/rss.xml
http://dhumc.com/site/feed/
http://finalfridayslawrence.wordpress.com/feed/
http://freestateflyfishers.org/feed/
http://heritagebaptistchurch.cc/wp-content/plugins/nextgen-gallery/xml/media-rss.php
http://kansaspublicradio.org/index.php?format=feed&type=atom
http://kansaszencenter.org/?feed=rss
http://lawrenceartscenter.org/comments/feed/
@jefftriplett
jefftriplett / LocalProcfile
Created August 27, 2013 22:48
Fun with multiple Heroku Procfiles
web: gunicorn hello:app

Greetings from the Amazon Associates Program.

We are writing from the Amazon Associates Program to notify you that your Associates account will be closed and your Amazon Services LLC Associates Program Operating Agreement will be terminated effective August 27, 2013. This is a direct result of the unconstitutional Missouri state tax collection legislation passed by the state legislature and signed by Governor Nixon on July 5, 2013, with an effective date of August 28, 2013. As a result, we will no longer pay any advertising fees for customers referred to an Amazon Site after August 27 nor will we accept new applications for the Associates Program from Missouri residents.

Please be assured that all qualifying advertising fees earned prior to August 28, 2013 will be processed and paid in full in accordance with your regular advertising fee schedule. Based on your account closure date of August 27, 2013, any final payments will be paid by October 31, 2013.

While we oppose this unconstitutional state legislati