Skip to content

Instantly share code, notes, and snippets.

Avatar

Greg Reinbach reinbach

View GitHub Profile
View keybase.md

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 Jan 24, 2013
Server to deliver angularjs application files.
View angularjs_server.py
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 Feb 13, 2012
Convert dir from url_pattern to brand_code
View gist:1818298
#!/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 Nov 7, 2011
view vgc prompt template snippets for facebook interaction
View view_vgc_prompt
{% 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 Sep 10, 2011 — forked from pokstad/rediswebpy.py
Redis session store backend for web.py
View rediswebpy.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})