Skip to content

Instantly share code, notes, and snippets.

View kriwil's full-sized avatar

Aldiantoro Nugroho kriwil

View GitHub Profile
docker ps -a | grep Exit | awk '{print $1}' |xargs docker rm
class AccountForm(forms.ModelForm):
class Meta:
model = Account
fields = ['first_name', 'last_name', 'email', 'password']
def __init__(self, *args, **kwargs):
self.university = kwargs.pop('university')
self.high_school = kwargs.pop('high_school')
self.department = kwargs.pop('department')
#!/bin/env python
ENGINE_FILE = 'Engine_Cytogenetics.xml'
QUIZBLOCKS_FILE = 'QuizBlocks_Cytogenetics.xml'
from lxml import etree
def extract_quizblocks():
"""
extract quizblocks from unity engine.
{% extends "payment/base_payment.html" %}
{% load custom_template %}
{% load staticfiles %}
{% block content %}
<div class="block-area">
<h3 class="block-title">Buy lab</h3>
</div>
<div class="block-area">
<div class="tile p-15">
...
super(PaymentForm, self).__init__(*args, **kwargs)
lab_choice = Lab.objects.all().values_list('pk', 'name')
self.fields['lab'].choices = lab_choice
...
class CreatePaymentTest(TestCase):
def setUp(self):
self.user = UserFactory()
self.payment = PaymentFactory()
self.product = ProductFactory()
self.url = reverse('api:create-payment')
self.headers = get_auth_header(self.user)
def test_post_new(self):
@kriwil
kriwil / test.py
Created September 29, 2014 07:41
class CreatePaymentTest(TestCase):
def setUp(self):
self.user = UserFactory()
self.payment = PaymentFactory()
self.product = ProductFactory()
self.url = reverse('api:create-payment')
self.headers = get_auth_header(self.user)
def test_post_new(self):
FROM kriwil/docker-pywebapp
MAINTAINER aldi <[email protected]>
RUN apt-get update
# posgis
RUN apt-get install -y binutils
RUN apt-get install -y libproj-dev
RUN apt-get install -y gdal-bin
docker run -p 127.0.0.1:8000:8000 \
-e AWS_ACCESS_KEY_ID=$AWS_ACCESS_KEY_ID \
-e AWS_SECRET_ACCESS_KEY=$AWS_SECRET_ACCESS_KEY \
-e EMAIL_HOST_PASSWORD=$EMAIL_HOST_PASSWORD \
--name littlemed_web \
--link postgis:db \
-d littlemed:latest
<?php
include("inc/include.php");
$points_upload = intval($config['points_upload']);
$SID = intval($_SESSION['USERID']);
$SVERIFIED = intval($_SESSION['VERIFIED']);
if ($SID != "" && $SID >= 0 && is_numeric($SID) && ($SVERIFIED > 0))
{
$ctime = 24 * 60 * 60;