Skip to content

Instantly share code, notes, and snippets.

View sgammon's full-sized avatar
:shipit:
f*ck it, ship it

Sam Gammon sgammon

:shipit:
f*ck it, ship it
View GitHub Profile
@sgammon
sgammon / Cakefile
Created March 26, 2012 22:16
momentum.io's cool ass cakefile
fs = require 'fs'
path = require 'path'
util = require 'util'
wrench = require 'wrench'
{exec, spawn} = require 'child_process'
fixpath = (fragments...) =>
return path.normalize(path.join(fragments...))
defaults =
@sgammon
sgammon / bootstrap.py
Created March 26, 2012 23:10
the magic fix for the dev server's bullshit
import sys
if 'lib' not in sys.path:
# Add lib as primary libraries directory, with fallback to lib/dist
# and optionally to lib/dist.zip, loaded using zipimport.
sys.path[0:0] = ['lib', 'lib/dist', 'lib/dist.zip']
class AppBootstrapper(object):
@sgammon
sgammon / content.py
Created March 26, 2012 23:01
cms message structures
from protorpc import messages
class GetContentRequest(messages.Message):
''' Retrieve a content snippet. '''
snippet_key = messages.StringField(1)
snippet_keyname = messages.StringField(2)
@sgammon
sgammon / bootstrap.py
Created March 26, 2012 23:08
the magic fix for the dev server's bullshit
import sys
if 'lib' not in sys.path:
# Add lib as primary libraries directory, with fallback to lib/dist
# and optionally to lib/dist.zip, loaded using zipimport.
sys.path[0:0] = ['lib', 'lib/dist', 'lib/dist.zip']
class AppBootstrapper(object):
@sgammon
sgammon / content.py
Created March 26, 2012 23:11
the content service
import hashlib
from protorpc import remote
from protorpc import message_types
from apptools import BaseService
from apptools.services import RequestError
from project.messages import content as messages
@sgammon
sgammon / buildout.cfg
Created March 26, 2012 23:22
buildout config file
############################################################
# AppEngine Toolkit - Buildout Configuration #
# ================================================== #
# DIRECTIONS: To automatically install libs from PYPI #
# (http://pypi.python.org), add the lib name to the #
# "eggs" entry in the 'app_lib' section. #
# #
# AN (INCOMPLETE) SELECTION OF USEFUL LIBS: #
# geomodel - For working with geospatial data #
# html5lib - Python parser for HTML5, full DOM #
@sgammon
sgammon / Cakefile
Created March 31, 2012 00:37
momentum.io's cool ass cakefile v2
fs = require 'fs'
path = require 'path'
util = require 'util'
wrench = require 'wrench'
{exec, spawn} = require 'child_process'
fixpath = (fragments...) =>
return path.normalize(path.join(fragments...))
defaults =
@sgammon
sgammon / structure.sass
Created June 7, 2012 14:23
div structure
#topbox
.nav
li
a.href
#nav2
.menu2
li.sub1
ul
li.sub2
@sgammon
sgammon / mixin.py
Created June 12, 2012 23:10
Message converter!
#### +=+=+=+ Service Layer Mixins +=+=+=+ ####
class MessageConverterMixin(ModelMixin):
''' Mixin class for automagically generating a ProtoRPC Message class from a model. '''
def to_message(self, include=None, exclude=None):
response = self._message_class()
if self.key is not None:
response.key = self.key.urlsafe()
@sgammon
sgammon / Cakefile
Created June 13, 2012 02:18
Updated Cakefile w/Widgets
fs = require 'fs'
path = require 'path'
util = require 'util'
wrench = require 'wrench'
{exec, spawn} = require 'child_process'
fixpath = (fragments...) =>
return path.normalize(path.join(fragments...))
defaults =