Skip to content

Instantly share code, notes, and snippets.

@za
za / requirements-stamps.txt
Created March 5, 2014 03:09
Stamps and Zocko requirements.txt
django==1.6.2
django-extensions==1.3.0
django-model-utils==1.3.0
redis==2.6.2
South==0.8.4
django-compressor==1.3
BeautifulSoup==3.2.1
easy-thumbnails==1.4
rq==0.3.8
django-rq==0.5.1
@za
za / gist:9871a5315dd54375fa40
Created July 15, 2014 04:57
mechanize to automate (programmatic) stateful web browsing
11:47 < za> sugiana: cara otomasi akses info (query) ke ib mandiri gimana?
11:48 < sugiana> pakai mechanize
11:48 < sugiana> browser by script
11:49 < sugiana> situ pakai debian ?
11:50 < za> sugiana: 'situ' mengacu siapa? :B
11:50 < za> ini ya mas https://pypi.python.org/pypi/mechanize/ ?
11:50 < sugiana> iya, situ is last except me
11:52 < za> saya ada mesin debian/ubuntu :B
11:53 < sugiana> buat /etc/apt/sources.list.d/rab.list isinya: deb http://debian.rab.co.id/custom ./
11:53 < sugiana> apt-get update; apt-get install internet-banking
@za
za / python3-pandas-ipython3.md
Last active August 29, 2015 14:24
Setting Up Python3 Pandas and IPython3 on Ubuntu

Search for python3 pandas package

$ apt-cache search pandas

python-pandas - data structures for "relational" or "labeled" data
python-pandas-lib - low-level implementations and bindings for pandas
python3-pandas - data structures for "relational" or "labeled" data - Python 3
python3-pandas-lib - low-level implementations and bindings for pandas - Python3
@za
za / venv-python3-pandas-ipython3.md
Last active August 29, 2015 14:24
Python3 Pandas and IPython3 in a Virtual Environment

Instead of installing in a system-wide environment, we can setup in a localidzed, separated environment.

Create new virtualenv:

$ virtualenv --python=`which python3` open-data-crunch

Activate open-data-crunch virtualenv

@za
za / reverse.py
Created July 15, 2015 03:58
Python2 reverse string with for loop
a = 'Newton'
for i in range(1, len(a)+1):
print a[-i]
@za
za / python3-reverse.py
Last active August 29, 2015 14:24
Python 3 Reverse String with Loop
a = 'Newton'
for i in range(1, len(a)+1):
print(a[-i], end="")
@za
za / pyconau-pyvideo-diff.txt
Created November 5, 2015 23:29
The missing PyCon AU 2015 videos URL at pyvideo
https://www.youtube.com/watch?v=0FOQB4PZVe0
https://www.youtube.com/watch?v=1ABPQyANid0
https://www.youtube.com/watch?v=1KHM7WvNeL4
https://www.youtube.com/watch?v=2e9dMr5sErs
https://www.youtube.com/watch?v=6aSKs4_WdkI
https://www.youtube.com/watch?v=8BUuq0KVXm0
https://www.youtube.com/watch?v=9yiiwcntx5M
https://www.youtube.com/watch?v=BiFUDT4aGFk
https://www.youtube.com/watch?v=HhcotmeioT8
https://www.youtube.com/watch?v=Ie7XdxTL5MY
@za
za / .bash_aliases
Last active November 17, 2015 01:02
Git Bash Prompt
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset
@za
za / Postgres.md
Last active November 22, 2015 02:58
Postgres 101

Postgres 101

login

  • sudo su - postgres

createuser

aka createrole

  • createuser --help
  • createuser --interactive
@za
za / idea.md
Created December 1, 2015 01:52
DRF

DRF

lists as input

dict as input