Skip to content

Instantly share code, notes, and snippets.

# -*- coding: utf-8 -*-
import os, sys, locale
import site, os
locale.setlocale(locale.LC_TIME,'ru_RU.utf8')
#projects_root = '/home/codeboy/xxx/svn2/'
#
#if projects_root not in sys.path:
@codeboy
codeboy / Base.js
Created August 8, 2012 16:01
ExtJs template
// КОНТРОЛЛЕР
Ext.define('C300.controller.Base', {
extend: 'Ext.app.Controller',
stores:[
'C300.store.streetStore'
],
views: [
@codeboy
codeboy / sms_sender.py
Last active December 19, 2015 19:18
send sms via smsaero.ru
###
# Sending sms via smsaero.ru gate
###
import requests
import time
import hashlib
def sms_sender(
number='79825552211',
@codeboy
codeboy / tree.md
Created July 16, 2013 13:32 — forked from hrldcpr/tree.md

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!

Python Number Conversion Chart

From To Expression
@codeboy
codeboy / test.py
Last active December 19, 2015 21:48
def get_context(self, request):
context = self.context
query = '''
SELECT pp.*, cc.*, au.*, row_to_json(rf.*) as recv_fund, row_to_json(ci.*) as invoice FROM payments_payment pp
LEFT JOIN customers_customer cc ON cc.id=pp.customer_id
LEFT JOIN auth_user au ON au.id=cc.user_id
LEFT JOIN payments_receivedfund rf ON pp.op_type=0 AND rf.id=pp.target
LEFT JOIN customers_customerinvoice ci ON pp.op_type=2 AND ci.id=pp.target
'''
q_payments, q_rows = db_aliases_query_dict(query, 'hosting')
# Copyright (c) 2010, Philip Plante of EndlessPaths.com
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
import tornado.ioloop
import tornado.web
import tornado.gen
import tornado.httpclient
class GenAsyncHandler(tornado.web.RequestHandler):
@tornado.web.asynchronous
@tornado.gen.engine
def get(self):
@codeboy
codeboy / CV_Resume.markdown
Last active January 27, 2024 19:25
Maxim Vavilov - Full-stack Python developer - CV (resume)

Меня зовут Вавилов Максим.

Я программист на Python/Django и Javascript.

Skype - codeboy.ru

Опыт более 10 лет работы в разработке интернет проектов. Принял участие в создании и развитии десятках различных проектов. От сложных, до очень сложных. Умею работать как в большой команде, так и один. Могу разрабатывать проекты, как с нулевой стадии, так и переделывать уже действующие. Способен спасти даже самый пропащий проект.

@codeboy
codeboy / gist:923f74b72abda9502f42
Created February 1, 2015 15:50
A very simple example of python code to us with python-libtorrent
'''
You should try libtorrent (rasterbar). http://libtorrent.org
If you want to write your client in python, on linux, install it with:
sudo apt-get install python-libtorrent
A very simple example of python code to use it to download a torrent:
'''
import libtorrent as lt