Skip to content

Instantly share code, notes, and snippets.

View camsom's full-sized avatar

Cameron Lowe camsom

View GitHub Profile
from django.template.loader import render_to_string
import boto
from stakeholder.models import *
from message.utils import SendEmailMixin
CONFIRMATION_SUBJECT = 'Activate your account with NextTier'
CONFIRMATION_TEMPLATE = 'email/confirm.txt'
CONFIRMATION_TEMPLATE_HTML = 'email/confirm.html'
ERROR_FUNCTION = '''
CREATE OR REPLACE FUNCTION erf(x decimal) RETURNS decimal AS $$
DECLARE a1 decimal = 0.254829592;
DECLARE a2 decimal = -0.284496736;
DECLARE a3 decimal = 1.421413741;
DECLARE a4 decimal = -1.453152027;
DECLARE a5 decimal = 1.061405429;
DECLARE p decimal = 0.3275911;
DECLARE sign integer = 1;
DECLARE t decimal;
VAGRANTFILE_API_VERSION = "2"
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "private_network", ip: "192.168.13.81"
config.vm.network "forwarded_port", guest: 8100, host: 8100
config.vm.synced_folder "../../", "/vagrant/"
config.vm.provision "shell",
config.vm.provision "shell",
inline: "apt-get -y update && apt-get -y install docker.io"
config.vm.provision "shell",
class Post(object):
def __init__(self, *args, **kwargs):
self.created_time = kwargs.pop("created_time")
self.author = kwargs.pop("from")["name"]
self.message = kwargs.pop("message", "")
self.link_url = kwargs.pop("link", "")
self.picture_url = kwargs.pop("picture", "")
self.description = kwargs.pop("description", "")
self.is_comment = kwargs.pop("is_comment", False)
def by_ten(x):
return x * 10
print by_ten(4)
# output should be 40
db:
image: orchardup/postgresql
ports:
- 5432
web:
build: .
command: python manage.py runserver 0.0.0.0:49001 --settings=reputationconsole.local_settings
volumes:
- .:/project_root
ports:

List

{
  "fields": {
    "title": {
      "type": "string",
      "required": True,
      "read_only": False,
      "max_length": 512