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
def seq_roles(role): | |
def attach_roles(func): | |
@wraps(func) | |
def inner_decorator(*args, **kwargs): | |
for host in env.roledefs[role]: | |
with settings(host_string = host): | |
func(*args, **kwargs) | |
return inner_decorator | |
return attach_roles |
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
1) Cut whole in top of water melon. | |
2) Boar out fist sized whole for dry ice and liquer and possibly sugar/mixer of some form. | |
3) Use stick to puncter small hole in water melon | |
4) Alternate adding dry ice cubes(size description) and brown liquor(whiskey or tiquela) | |
5) Monitor reaction. | |
6) Close top. | |
7) Monitor reaction, maybe poke hole. | |
8) Add more alcohol throughout the day. |
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
from fabric.api import env | |
def list_machines(*args, **kwargs): | |
""" | |
Wrapper for listing machines which match every tag. The current api behavior | |
is to return a list for any matching tags. | |
""" | |
tags = kwargs.get('tags') | |
lol_machines = [] # list of sets of machines | |
for key, value in tags.iteritems(): |
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
CONTEXT: start | |
USER: got resource | |
ITER: yielding 1 | |
USER: yielding 1 | |
GOT: 1 | |
ITER: yielding 2 | |
USER: yielding 2 | |
GOT: 2 | |
ITER: yielding 3 | |
USER: yielding 3 |
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
#custom stuff | |
function virtualenv_info { | |
[ $VIRTUAL_ENV ] && echo ''`basename $VIRTUAL_ENV`') ' | |
} | |
PS1="\n\[\e[35;1m\]┌───=[ \[\e[37;0m\]\u \[\e[35;1m\]:: \[\e[37;1m\]\h \[\e[35;1m\]-( \[\e[37;1m\]\j\[\e[35;1m\] )-[ \[\e[37;0m\]\w\[\e[35;1m\] ]\n\[\e[35;1m\]└──(\$(virtualenv_info)\[\e[0m\]" | |
VIRTUAL_ENV_DISABLE_PROMPT=1 | |
export WORKON_HOME=$HOME/.virtualenvs |
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 ContentField(models.ForeignKey): | |
def __init__(self, *args, **kwargs): | |
self.encodings = kwargs.pop('encodings') | |
self.required_fields = set(kwargs.pop('required_fields')) | |
args = list(args) | |
args.insert(0, 'basecontent.BaseContent') | |
super(ContentField, self).__init__(*args,**kwargs) | |
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
{ | |
"description": "adsfasdfasdfasdfdasf", | |
"id": 1, | |
"members": [ | |
{ | |
"content": { | |
"body": { | |
"created": "2013-05-17T16:25:42.082347", | |
"data": "/media/data/change-the-conversation_4.md", | |
"encoding": "md", |
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 PolymorphicRelatedField(fields.ToOneField): | |
def get_related_resource(self, related_instance): | |
""" | |
Instaniates the related resource. | |
""" | |
to = { | |
models.Asset: AssetResource, | |
models.Content: ContentResource, |
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 MultipartResource(object): | |
def deserialize(self, request, data, format=None): | |
if not format: | |
format = request.META.get('CONTENT_TYPE', 'application/json') | |
if format == 'application/x-www-form-urlencoded': | |
return request.POST | |
if format.startswith('multipart'): | |
data = request.POST.copy() |
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
<html> | |
<head> | |
</head> | |
<body style="margin: 0px;"> | |
<script> | |
var resize = function(){ | |
window.parent.postMessage(window.document.body.offsetHeight,"*"); | |
} | |
window.document.body.onload = resize; | |
window.document.body.addEventListener("DOMNodeInserted", resize); |
OlderNewer