This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteEngine on | |
RewriteMap lowercase int:tolower | |
RewriteRule ^ - [E=SERVER_NAME:${lowercase:%{SERVER_NAME}}] | |
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC] | |
RewriteRule ^(.*) https://%1$1 [R=301,L] | |
ProxyPassInterpolateEnv On | |
ProxyRequests Off |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC] | |
RewriteRule ^(.*) https://%1$1 [R=301,L] | |
RewriteCond %{HTTP_HOST} ^mysubdomain\.mysite\.com | |
RewriteRule ^/(.*)$ http://127.0.0.1:9090/VirtualHostBase/https/%{SERVER_NAME}:%{SERVER_PORT}/subdomain/VirtualHostRoot/$1 [L,P] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
$custom_fragment_proxy_pass = ' | |
RewriteEngine on | |
RewriteMap lowercase int:tolower | |
RewriteRule ^ - [E=SERVER_NAME:${lowercase:%{SERVER_NAME}}] | |
ProxyPassInterpolateEnv On | |
BrowserMatch "MSIE [2-6]" \ | |
nokeepalive ssl-unclean-shutdown \ | |
downgrade-1.0 force-response-1.0 | |
BrowserMatch "MSIE [17-9]" ssl-unclean-shutdown' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
class Toy(object): | |
inventory = 0 | |
def __init__(self, price, name, quantity): | |
self.price = price | |
self.name = name | |
self.quantity = quantity |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from django.db import models | |
from django.contrib.localflavor.us.models import USStateField, PhoneNumberField | |
def save_area(instance, file_name): | |
return "photos/%s/%s/%s" % (instance.area.state, instance.area.name, file_name) | |
# WAT is this? if this is about using nice urls then use url routing instead | |
def save_problem(instance, file_name): | |
return "photos/%s/%s/%s/%s" % (instance.problem.parent.state, instance.problem.parent.name, instance.problem.name, file_name) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/python | |
import urllib2 | |
import csv | |
import datetime | |
import math | |
class GmaneListStats(object): | |
def __init__(self, what_is_recent=30, group='gmane.comp.web.zope.plone.devel'): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/python | |
from lxml import html | |
import datetime | |
import requests | |
from collections import defaultdict | |
def parse(html_string, impact=None): | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Tutorial at http://docs.sqlalchemy.org/en/rel_0_8/orm/tutorial.html | |
Data at http://pastie.org/5659260 | |
Key Points: | |
- requires: sqlalchemy, psycopg2 | |
- Setting up new database and user | |
- Difference between sql, postgres, sqlite | |
- Sqlite and timezones | |
- Connecting to the DB and DSNs |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import urllib2 | |
from lxml.html import fromstring | |
import json | |
def collate_data(): | |
print "beginning collating..." | |
# get the list of users from noisebridge wiki | |
# and put them in a dictionary with userid as key |
NewerOlder