Skip to content

Instantly share code, notes, and snippets.

View quamilek's full-sized avatar

Kamil Warguła quamilek

  • Allegro Group
  • Poznań, Poland
View GitHub Profile
@quamilek
quamilek / huey_subscrive_events.md
Created January 14, 2016 08:13
Example for consuming `RedisEventEmitter` in python huey lib https://github.com/coleifer/huey
@quamilek
quamilek / dualport.py
Created September 11, 2015 11:56
Dual port python server
# -*- coding: utf-8 -*-
import threading
import time
import SocketServer
import sys
class ThreadedTCPRequestHandler(SocketServer.BaseRequestHandler):
@quamilek
quamilek / ubuntu_rw_mode.bash
Created September 7, 2015 20:55
Ubuntu Phone read write mode
sudo mount -o rw,remount /
@quamilek
quamilek / api.py
Created August 31, 2015 20:19
Example Python app implement simple REST API running through Gunicorn
import argparse
import json
import falcon
from gunicorn.app.base import BaseApplication
from gunicorn.six import iteritems
class StandaloneApplication(BaseApplication):
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.0">
<Document>
<name>M58/1</name>
<Placemark><name>GeoB8501-2</name><Point><coordinates>16.571662,52.2441918</coordinates></Point></Placemark>
</Document>
</kml>
@quamilek
quamilek / anyconfig_bug.py
Created May 18, 2015 13:15
Anyconfig load the wrong file - with usage with Jinja2 templating.
```python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import anyconfig
import os
from pprint import pprint
CONFIG_IN_CURR_DIR = 'name: Doktor No'
@quamilek
quamilek / poznan.fmr
Created March 27, 2015 13:17
Poznań radio stations
87700000:Polskie Radio Jedynka
88400000:Radio Złote Przeboje
89100000:Polskie Radio Dwójka
89500000:Radio Plus Gniezno
89800000:Radio Emaus
90600000:Radio ZET Gold
90900000:Polskie Radio Trójka
91900000:PR Radio Merkury
92300000:Polskie Radio Jedynka
93000000:Radio ESKA Poznań
@quamilek
quamilek / csv-splitter.py
Created May 13, 2014 09:47
Simple csv splitter
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
def split_file(file_name, max_line_count):
header = None
new_file_counter = 1
line_counter = 0
@quamilek
quamilek / copy_img_to_raspberry.sh
Created January 12, 2014 19:44
Copy os image to sdcard Raspberry pi
sudo dd bs=4M if=/path/to/image of=/dev/sdc
@quamilek
quamilek / django_uml_models.txt
Created September 26, 2013 11:15
uml django models
Getting It
You can get Django Extensions by using pip or easy_install:
$ pip install django-extensions
or
$ easy_install django-extensions
If you want to install it from source, grab the git repository from GitHub and run setup.py:
$ git clone git://github.com/django-extensions/django-extensions.git