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
class MyCallable(object): | |
def __init__(self, urlparts, callable): | |
self.urlparts = urlparts | |
self.callable = callable | |
def __call__(self, **kwargs): | |
print kwargs | |
print self.urlparts | |
def __getattr__(self, name): | |
# Return a callable object of this same type so that you can just keep | |
# chaining together calls and just adding that missing attribute to the |
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
** Structure should have repo directory then django project directory under it. | |
** Only files that are committed to the repo are used in deployment. | |
** Make sure to not have any other .git projects/directories in your project | |
other than the one at the top level. This causes problems like not finding | |
settings files, etc. | |
** <project> refers to the 'main' project where your git repository (.git | |
directory resides) | |
** <project_name> refers to the 'main' django project directory (were | |
settings.py resides) |
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/sh | |
# This is a function so that we can use 'workon' to switch since it will | |
# refresh the environment and pass it onto the caller. Thus, no reason to run | |
# another shell after this command or calling workon manually, etc. | |
start_virtualenv_main() { | |
# Assume your working in the directory of the project name | |
curr=`pwd` | |
proj=`basename $curr` |
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
This is an updated test from frappy |
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
Liquid Snobs (DIY Drinker) | |
- Categories (post type): | |
1. Coffee | |
2. Beer | |
3. Cocktails | |
** might could add tea or something else | |
- Each part has it's own slightly different css/look and feel |
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/bash | |
# --------------------------------------------------------------------------- | |
# OO support functions | |
# Kludged by Pim van Riezen <[email protected]> | |
# http://lab.madscience.nl/oo.sh.txt | |
# --------------------------------------------------------------------------- | |
DEFCLASS="" | |
CLASS="" | |
THIS=0 |
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 sys, types | |
module = sys.modules[__name__] | |
for name, var in vars(module).items(): | |
if type(var) == types.FunctionType and name.startswith('filter_'): | |
value = var(value) |
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
#django dash test |
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
class ListChunk: | |
def __init__(self, items, chunksize): | |
self.items = items | |
self.chunksize = chunksize | |
self.ii = 0 | |
def __iter__(self): | |
return self | |
def next(self): | |
if self.ii >= len(self.items): | |
raise StopIteration |
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
Install rvm (ruby community equivalent of virtualenv): | |
- bash < <(curl -s https://rvm.beginrescueend.com/install/rvm) | |
Install ruby 1.9.2: | |
- rvm install 1.9.2 && rvm use 1.9.2 --default | |
Heroku: | |
- gem install heroku | |
- heroku create --stack cedar | |
- Automatically adds a git remote called 'heroku' |
OlderNewer