Skip to content

Instantly share code, notes, and snippets.

View reinbach's full-sized avatar

Greg Reinbach reinbach

View GitHub Profile

Keybase proof

I hereby claim:

  • I am reinbach on github.
  • I am reinbach (https://keybase.io/reinbach) on keybase.
  • I have a public key ASAyUwI8X0QadcfAzZa4ZgELeKrscohnjjBAjBton_SwSQo

To claim this, I am signing this object:

@reinbach
reinbach / angularjs_server.py
Created January 24, 2013 16:01
Server to deliver angularjs application files.
import os
from werkzeug.exceptions import NotFound
from werkzeug.wrappers import Request, Response
from werkzeug.wsgi import SharedDataMiddleware, wrap_file
class Website(object):
def dispatch_request(self, environ, request):
filename = request.path if request.path != "/" else "index.html"
@reinbach
reinbach / gist:1818298
Created February 13, 2012 17:00
Convert dir from url_pattern to brand_code
#!/usr/bin/env python
#
# brand templates are stored in url_pattern values
# script converts these dirnames to brand_code values
#
# for each dir in the brand template
# find the brand based on the dir being url_pattern of a brand
# get the brand code for the brand
# change the dir name to the brand_code value
@reinbach
reinbach / view_vgc_prompt
Created November 7, 2011 02:05
view vgc prompt template snippets for facebook interaction
{% if facebook_apikey %}
<script src="https://connect.facebook.net/en_US/all.js"></script>
<script type="text/javascript">
FB.init({
apiKey: "{{ facebook_apikey }}",
status: true,
cookie: true,
xfbml: true
});
@reinbach
reinbach / rediswebpy.py
Created September 10, 2011 04:18 — forked from pokstad/rediswebpy.py
Redis session store backend for web.py
import redis
import web
SESSION = 'SESSION:'
class RedisStore(web.session.Store):
"""Store for saving a session in redis:
import rediswebpy
session = web.session.Session(app, rediswebpy.RedisStore(), initializer={'count': 0})