Skip to content

Instantly share code, notes, and snippets.

View piontas's full-sized avatar

Marek Piatek piontas

View GitHub Profile

Keybase proof

I hereby claim:

  • I am piontas on github.
  • I am piontas (https://keybase.io/piontas) on keybase.
  • I have a public key ASC33PPbkU35Ga7zvQYVJZjTGD6u1dccDMbIQ7uROVP-WQo

To claim this, I am signing this object:

@piontas
piontas / data.txt
Created October 8, 2014 23:41
usage: ./program.py --xml ./data.txt or ./program.py --json ./data.txt
0: a:1, x:2, w:3
1: b:1, c:3, t:5
@piontas
piontas / rom2arabic.py
Created August 25, 2014 11:37
Convert numbers in Roman numerals to Arabic numerals.
# -*- coding: utf-8 -*-
#!/usr/bin/env python
import sys
import os
m = {
'I': 1,
'V': 5,
'X': 10,
'L': 50,
@piontas
piontas / update_index.py
Created August 25, 2014 11:32
Django Haystack update index script
# -*- coding: utf-8 -*-
import logging
import subprocess
python_path = "/home/Environment/project/bin/python"
project_dir = "/home/production/project/"
log = "/var/log/update_index.log"
def update_index():
-- OPTION 1
Removes ll previous tables of sales, shipments,invoices etc…
SET FOREIGN_KEY_CHECKS=0;
TRUNCATE `sales_flat_creditmemo`;
TRUNCATE `sales_flat_creditmemo_comment`;
#!/usr/bin/env python
import sys
import os
m = {
'I': 1,
'V': 5,
'X': 10,
'L': 50,
'C': 100,