Skip to content

Instantly share code, notes, and snippets.

View andrewsmedina's full-sized avatar

Andrews Medina andrewsmedina

View GitHub Profile
class Action(object):
def backward(self):
raise NotImplemented
def forward(self):
raise NotImplemented
class Pipeline(object):
def __init__(self, actions):
args := []string{}
args = append(args, "ble")
tsuru-admin platform-add python --dockerfile https://raw.githubusercontent.com/tsuru/basebuilder/master/python/Dockerfile
@register.simple_tag(takes_context=True)
def mytag(context, obj, user, as, name):
check_published = True
if user.is_staff or user.is_superuser:
check_published = False
context[name] = obj.all_images(check_published)
return ''
#! /bin/bash
echo $@
$ python
Python 2.7.1 (r271:86832, Jun 16 2011, 16:59:05)
[GCC 4.2.1 (Based on Apple Inc. build 5658) (LLVM build 2335.15.00)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> ...
File "<stdin>", line 1
...
^
SyntaxError: invalid syntax
>>> ^D
class Like(models.Model):
content_type = models.ForeignKey(ContentType)
object_id = models.PositiveIntegerField()
content_object = GenericForeignKey('content_type', 'object_id')
class Post(models.Model):
pass
class Photo(models.Model):
pass
class Like(models.Model):
photo = models.ForeignKey(Photo)

Deploying Go applications in tsuru

Overview

#!/bin/bash
PREFIX=registry.cloud.tsuru.io/tsuru/
read command
for image in "$@"
do
echo "Generating $image... "
full_image=${PREFIX}${image}
id=`docker -H 127.0.0.1:4243 run -d $full_image $command`