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 / 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: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 =
@sgammon
sgammon / tpl.html
Created June 18, 2012 05:22
template patch
{% extends "layout/layout_base.html" %}
{% block stylesheets %}
<link rel="stylesheet" href="{{ asset.style('landing', 'openfire') }}">
{% endblock stylesheets %}
{# These blocks intentionally left empty to disable the tinylogo and leftnav on the homepage. #}
{%- block leftnav -%}{%- endblock leftnav -%}
{%- block tinylogo -%}{%- endblock tinylogo -%}
@sgammon
sgammon / export.xml
Created June 22, 2012 06:06
Criterion Content
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0">
<channel>
<title>Criterion Institute</title>
<description>Content export for Criterion</description>
<link>http://criterioninstitute.org</link>
<lastBuildDate>Mon, 06 Sep 2010 00:01:00 +0000 </lastBuildDate>
<pubDate>Mon, 06 Sep 2009 16:45:00 +0000 </pubDate>
<ttl>1800</ttl>
@sgammon
sgammon / index.yaml
Created June 29, 2012 19:27
Dev server indexes
indexes:
- kind: Project
properties:
- name: class
- name: n
- kind: _AE_Pipeline_Record
properties:
- name: class_path