Skip to content

Instantly share code, notes, and snippets.

FROM postgres:9.4
MAINTAINER whiteblackcat
RUN apt-get update && apt-get install -y curl python-dev lzop pv daemontools build-essential
RUN curl -kL https://bootstrap.pypa.io/get-pip.py | python
RUN pip install gevent
RUN pip install wal-e
RUN pip install envdir
RUN mkdir -p /etc/wal-e.d/env
@ccat
ccat / SignUp.cs
Created August 22, 2016 01:02
Sample code to sign up Amazon Cognito user pool for Xamarin
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Xamarin.Forms;
using Amazon;
using Amazon.CognitoIdentity;
using Amazon.CognitoIdentityProvider;
using Amazon.CognitoIdentityProvider.Model;
type ColumnType struct {
Name string
Type string
Size int64 //When Size is 0, size of the column can be variable
}
type Row map[string]interface{}
type TableInterface interface {
type ColumnType struct {
Name string
Type string
Size int64
}
type Row map[string]interface{}
type TableInterface interface {
[
{"Name":"name",
"Type":"string",
"Size":256},
{"Name":"height",
"Type":"float"},
{"Name":"weight",
"Type":"float"}
]
#CONFIG.
AWS_SECRET_ACCESS_KEY="secret-key-content"
AWS_ACCESS_KEY_ID="access-key"
WALE_S3_PREFIX="s3://some-bucket/directory/or/whatever"
AWS_REGION="ap-northeast-1"
sudo apt-get install python-pip lzop pv python-dev
sudo pip install wal-e envdir
sudo pip install -U requests six
#cloud-config
hostname: {{hostname}}
coreos:
update:
reboot-strategy: best-effort
units:
- name: docker.service
command: start
@ccat
ccat / django_test_tips.py
Last active April 10, 2016 04:40
Tips for django tests
from django.test import TestCase, RequestFactory
from django.core.urlresolvers import resolve,reverse
from django.http import HttpRequest
from django.template.loader import render_to_string
from django.contrib.auth.models import AnonymousUser, User
from django.contrib.messages.storage.fallback import FallbackStorage
class TestBasic(TestCase):
def setUp(self):
self.factory = RequestFactory()
click==6.3 # via pip-tools
coverage==4.0.3
django-nose==1.4.3
Django==1.9.4
first==2.0.1 # via pip-tools
nose==1.3.7 # via django-nose
pip-tools==1.6
psycopg2==2.6.1
pytz==2015.7
six==1.10.0 # via pip-tools
Django<1.10
psycopg2
pytz
pip-tools
pip
coverage
django-nose