Skip to content

Instantly share code, notes, and snippets.

View silpol's full-sized avatar
🏠
Email is best comm tool.

Andriy Tymchenko silpol

🏠
Email is best comm tool.
View GitHub Profile
@woodb
woodb / tree.md
Created May 10, 2012 00:25 — forked from hrldcpr/tree.md
one-line tree in python

One-line Tree in Python

Using Python's built-in defaultdict we can easily define a tree data structure:

def tree(): return defaultdict(tree)

That's it!

@woodb
woodb / blog.ini
Created July 8, 2012 16:47
uWSGI configuration for simple blog
[uwsgi]
# Variables
base = /var/www/blog
app = simple
# Generic Config
plugins = http,python
home = %(base)/venv
pythonpath = %(base)
socket = /var/www/run/%n.sock
module = %(app)
@woodb
woodb / uwsgi.conf
Created July 8, 2012 16:46
Configuration file for uWSGI
description "uWSGI"
start on runlevel [2345]
stop on runlevel [06]
respawn
env UWSGI=/usr/bin/uwsgi
env LOGTO=/var/log/uwsgi/emperor.log
exec $UWSGI --master --emperor /etc/uwsgi/apps-enabled --die-on-term --uid nginx --gid nginx --logto $LOGTO
@woodb
woodb / default.conf
Created July 8, 2012 16:48
nginx configuration for uWSGI
server {
listen 80;
server_name blog;
server_name blog.example.com;
root /var/www/blog;
location /static/ {
alias /var/www/blog/static/;
expires 30d;
access_log off;
@lorin
lorin / blog.json
Created July 30, 2012 14:28
Example Mezzanine blog fixtures
[
{
"pk": 1,
"model": "blog.blogpost",
"fields": {
"status": 2,
"expiry_date": null,
"allow_comments": true,
"description": "This is an example of a blog post.",
"title": "example blog post",
@sampaiodiego
sampaiodiego / Install Lets Encrypt.md
Last active December 16, 2017 16:57
Steps to install Letsencrypt
@tedhagos
tedhagos / install-steps-gnu-health
Created January 2, 2012 03:07
Installation notes for GNU Health
1. Make sure you have the following requisites
- Debian or Ubuntu
- Postgresql
- Python
- Tryton
2. Install requisite software
2.1 apt-get install python-pip python-lxml python-relatorio python-psycopg2 posgresql python-tz
#!/usr/bin/env python
"""A noddy fake smtp server."""
import smtpd
import asyncore
class FakeSMTPServer(smtpd.SMTPServer):
"""A Fake smtp server"""
def __init__(*args, **kwargs):
@terotil
terotil / nda2csv.rb
Created January 10, 2013 21:03
Processor for Nordea machine readable bank statements (NDA format). Functionally minimal, just enough to outline a friendly interface and be able to export main transaction records to CSV, which is further processable to OFX using https://github.com/terotil/ofxify
require 'date'
module Nordea
module NDA
class Record
def self.parse(str)
self.new(str).normalized
end
def initialize(str)