Skip to content

Instantly share code, notes, and snippets.

@jvanasco
jvanasco / read_email.py
Created January 29, 2016 01:08
silly little file for reading postfix files on a dev server.
import argparse
import os
import subprocess
"""
$ mailq
show mail queue contents
$ sudo postcat -q {queue_id}
show message details
@jvanasco
jvanasco / dogpile_proxy.py
Created October 5, 2015 22:00
dogpile encoding
class _EncodedProxy(ProxyBackend):
def value_decode(self, value):
raise NotImplementedError("override me")
def value_encode(self, value):
raise NotImplementedError("override me")
def set(self, k, v):
v = self.value_encode(v)
@jvanasco
jvanasco / canned_reply.txt
Created August 21, 2015 15:42
canned reply for michael bayer
This bug report is being automatically closed because it did not meet one or more common-sense
and industry-standard reporting requirements.
Exact reasons have been marked below. If you can correct this, feel free to re-open.
___ The issue is not related to this library, but is a general issue with basic:
___ Python
___ Sql
___ The issue is not actually disclosed inline, but linked to an offsite article:
___ The issue is disclosed on StackOverflow.
@jvanasco
jvanasco / oauthlib_oauth1_interfaces.py
Created August 10, 2015 19:49
consolidated oauth1 object Interfaces used by oauthlib and flask-oauthlib
"""This explains some object interfaces used in validator.py
"""
class _DatabaseObject(object):
pass
class _Relationship(object):
pass
@jvanasco
jvanasco / test.py
Last active August 29, 2015 14:17
sqlalchemy desc error
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# Use this file to build your own SSCCE
# SSCCE = Short, Self Contained, Correct (Compatible) Example
# see http://sscce.org/
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@jvanasco
jvanasco / view.py
Created March 9, 2015 18:37
pyramid finished_callbacks change
from pyramid.view import view_config
def sample_callback(request):
pass
@view_config(route_name='home', renderer='templates/mytemplate.pt')
def my_view(request):
"""
1.6/master
BEFORE: request.finished_callbacks None
@jvanasco
jvanasco / 01-jv
Created March 5, 2015 19:32
Tech Support Exchange with Dreamhost, in which they completely ignore the question I ask.
I've been getting A TON of spam hitting my inbox lately. 20+ messages a day.
sometimes more. Usually in the topics of :
- Medicare
- Rewards cards (amazon, home depot)
- Background Checks
- Lawsuits
- EZPass
- Sex offender notification
- Auto Warranty
@jvanasco
jvanasco / example-association_proxy.py
Created February 11, 2015 19:13
association proxy example
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
#
# Use this file to build your own SSCCE
# SSCCE = Short, Self Contained, Correct (Compatible) Example
# see http://sscce.org/
#
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
@jvanasco
jvanasco / app.py
Created January 21, 2015 20:25
pyramid and render_to_resposne
from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.response import Response
from pyramid.renderers import render_to_response, render
def json_bad(request):
return render_to_response('json', {'hello': 'world'})
def json_good(request):
return render_to_response('json', {'hello': 'world'}, request=request)
@jvanasco
jvanasco / data.py
Created January 14, 2015 16:28
sqlachemy_history
{'0.1.0': {'pypi_file_md5': 'b74ed3d0d824ffaba34fc887784db4f3',
'pypi_file_url': 'https://pypi.python.org/packages/source/S/SQLAlchemy/SQLAlchemy-0.1.0.tar.gz#md5=b74ed3d0d824ffaba34fc887784db4f3',
'pypi_url': 'https://pypi.python.org/pypi/SQLAlchemy/0.1.0',
'release_date': u'2006-02-14'},
'0.1.1': {'pypi_file_md5': 'd88344c2a5628cc05d8d70ac5ddbe8ee',
'pypi_file_url': 'https://pypi.python.org/packages/2.4/S/SQLAlchemy/SQLAlchemy-0.1.1-py2.4.egg#md5=d88344c2a5628cc05d8d70ac5ddbe8ee',
'pypi_url': 'https://pypi.python.org/pypi/SQLAlchemy/0.1.1',
'release_date': u'2006-02-23'},
'0.1.2': {'pypi_file_md5': '74862475a8366f74ccca6ca1ce9b0c99',
'pypi_file_url': 'https://pypi.python.org/packages/2.4/S/SQLAlchemy/SQLAlchemy-0.1.2-py2.4.egg#md5=74862475a8366f74ccca6ca1ce9b0c99',