This file contains 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 flask import make_response | |
from reportlab.pdfgen import canvas | |
# ... | |
@app.route('/pdf') | |
def pdf(): | |
import cStringIO | |
output = cStringIO.StringIO() |
This file contains 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
>>> import re | |
>>> # mencari RMR Number pada Subject email | |
>>> "Re: RMR Number 121127-I01-07-1".rsplit(" ", 1)[1] | |
121127-I01-07-1 | |
>>> inputs = ["Re: RMR Number 121127-I01-07-1", "RMR Number 121127-I01-07-1", "Re: RMR NUmber 121127-I08-PP-1"] | |
>>> | |
>>> for a in inputs: | |
... m = re.match(r'.*RMR Number.*(?P<rmr>\d{6}-\w{1}\d{2}-.*-\d{1})', a, re.I) | |
... if m: | |
... m.groupdict()['rmr'] |
This file contains 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 | |
if [ "$1" != "RECEIVED" ]; then exit; fi; | |
#DB parameter | |
SQL_HOST=localhost | |
SQL_USER=enterprisedb | |
SQL_PASSWORD= | |
SQL_DATABASE=MitraLunas |
This file contains 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.db import models | |
from django.contrib.auth.models import User | |
from django.contrib.contenttypes.models import ContentType | |
from django.contrib.contenttypes import generic | |
from django.db.models import signals | |
class ModuleRef(models.Model): | |
""" | |
Referensi Module, Part Number |
This file contains 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
Deploy Django-Nginx-uwsgi pada web faction | |
referensi: http://community.webfaction.com/questions/10242/installing-nginx-uwsgi | |
APPNAME="tracker" | |
/home/narayana/webapps/tracker | |
bin | |
start | |
stop |
This file contains 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
Senam Mata | |
Posisi Kepala tegak | |
1. Gerakkan bola mata ke atas-bawah 5 - 10 kali | |
2. Gerakkan bola mata ke kiri-kanan 5 - 10 kali, seolah mau lihat telinga | |
3. Gerakkan bola mata ke atas, lalu kiri-kanan 5 - 10 kali | |
4. Gerakkan bola mata ke bawah, lalu ke kanan-kiri | |
5. Gerakkan bola mata ke atas-bawah dengan sudut mata saling menjauhi | |
6. Putar bola mata searah jarum jam, dari kiri, dan sebaliknya 5 - 10 kali |
This file contains 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
<?php | |
session_start(); | |
$found_session = false; | |
foreach ( array_keys($_SESSION) as $key ) { | |
if ( preg_match('/code/', $key) or preg_match('/user_id/', $key) or preg_match('/access_token/', $key) ) { | |
$found_session = true; | |
} |
This file contains 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
# | |
# Virtual Hosts | |
# | |
# If you want to maintain multiple domains/hostnames on your | |
# machine you can setup VirtualHost containers for them. Most configurations | |
# use only name-based virtual hosts so the server doesn't need to worry about | |
# IP addresses. This is indicated by the asterisks in the directives below. | |
# | |
# Please see the documentation at | |
# <URL:http://httpd.apache.org/docs/2.2/vhosts/> |
This file contains 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
/* Artfully masterminded by ZURB */ | |
/* -------------------------------------------------- | |
Table of Contents | |
----------------------------------------------------- | |
:: Shared Styles | |
:: Page Name 1 | |
:: Page Name 2 | |
*/ |
This file contains 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
# HW 5.2 | |
db.zips.aggregate([ | |
{$match: {$and : [{"state": {$in: ['CA', 'NY']}}]}}, | |
{$group: {_id: "$city", total: {$sum: "$pop"}}}, | |
{$match: {"total": {$gt: 25000}}}, {$group: {_id: 'kota', rerata: {$avg: "$total"}}} | |
]) | |
{ | |
"_id" : ObjectID(), | |
"name": "", |
OlderNewer