{
"fields": {
"title": {
"type": "string",
"required": True,
"read_only": False,
"max_length": 512
This file contains hidden or 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
| 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: |
This file contains hidden or 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 by_ten(x): | |
| return x * 10 | |
| print by_ten(4) | |
| # output should be 40 |
This file contains hidden or 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 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) |
This file contains hidden or 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
| 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", |
This file contains hidden or 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
| 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; |
This file contains hidden or 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 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' |
This file contains hidden or 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
| # build | |
| sudo docker build -t pokerap . | |
| # run | |
| sudo docker run -v /dev/log:/dev/log pokerap /go/bin/gokerap | |
| # check syslog | |
| sudo tail /var/log/syslog | |
| # here are the cool lines I like |
This file contains hidden or 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 ubuntu:14.04 | |
| RUN apt-get update | |
| RUN apt-get install -y curl git bzr | |
| RUN curl -s https://go.googlecode.com/files/go1.2.linux-amd64.tar.gz | tar -v -C /usr/local/ -xz | |
| ENV PATH /usr/local/go/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/bin:/sbin | |
| ENV GOPATH /go | |
| ENV GOROOT /usr/local/go |
This file contains hidden or 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
| SELECT * FROM date_table WHERE rankscore(); | |
| CREATE FUNCTION rank_score() RETURNS decimal as $$ | |
| BEGIN | |
| return date_table.birthday + interval '50 days' | |
| END; $$ |
NewerOlder