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
| DEBUG = os.getenv('DEBUG', False) | |
| STATIC_ROOT = 'static' | |
| STATIC_URL= '/static/' | |
| if DEBUG==False: | |
| STATIC_URL = 'http://{0}.s3.amazonaws.com/'.format(AWS_S3_BUCKET) |
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
| CREATE_TABLE_STATEMENTS = { | |
| 'achievement_achievement': | |
| '''CREATE TABLE achievement_achievement | |
| ( | |
| id int, | |
| title varchar(255), | |
| description text | |
| ); | |
| ''', | |
| 'task_task': |
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 CreateRetrieveUpdateDestroyApplication( | |
| generics.CreateAPIView, generics.RetrieveUpdateDestroyAPIView): |
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 post(self, request): | |
| serializer = CompletedAchievementCreateSerializer(data=request.DATA) | |
| if serializer.is_valid(): | |
| achievement = Achievement.objects.get(id=serializer.data['achievement']) | |
| stakeholder = Stakeholder.objects.get(id=serializer.data['stakeholder']) | |
| try: | |
| CompletedAchievement.objects.create( | |
| achievement=achievement, |
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
| base_task = Task.objects.create(institution=None, **bullshit_data) | |
| for institution in Institution.objects.all(): | |
| new_task = base_task | |
| new_task.pk = None | |
| new_task.institution = institution | |
| new_task.save() | |
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 __init__(self, *args, **kwargs): | |
| for k, v in kwargs: | |
| setattr(self, k, v) | |
| def __init__(self, *args, **kwargs): | |
| self.first_name = kwargs.pop('first_name', None) | |
| self.last_name = kwargs.pop('last_name', None) | |
| self.email = kwargs.pop('email', None) | |
| def __init__(self, first_name=None, last_name=None, email=None): |
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
| #!/bin/sh | |
| start on (filesystem) | |
| stop on runlevel [016] | |
| script | |
| . /var/lib/cloud/instance/user-data.txt | |
| chdir /home/ubuntu/NextTier-Achievement-Worker | |
| . /home/ubuntu/venv/bin/activate | |
| exec python /home/ubuntu/NextTier-Achievement-Worker/worker.py |
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; $$ |
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
| # 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 |
OlderNewer