Skip to content

Instantly share code, notes, and snippets.

View muminoff's full-sized avatar
🏠
Working from home

Sardor Muminov muminoff

🏠
Working from home
  • Electronic Arts
  • Seoul, Korea
View GitHub Profile
#!/usr/bin/env python
from twisted.internet import reactor
from twisted.internet import protocol
import msgpack
class UserHandler:
def hello0(self):
print "hello!"
return 0
@sublee
sublee / README.rst
Created September 28, 2010 08:03
Finger Binary ASCII art generator for Python

Finger Binary

What's Finger Binary?

Here is a description of `Finger Binary in Wikipedia`_.

Finger binary is a system for counting and displaying binary numbers on the
#!/usr/bin/env python
#
# Converts any integer into a base [BASE] number. I have chosen 62
# as it is meant to represent the integers using all the alphanumeric
# characters, [no special characters] = {0..9}, {A..Z}, {a..z}
#
# I plan on using this to shorten the representation of possibly long ids,
# a la url shortenters
#
@clintongormley
clintongormley / html_strip.sh
Created January 15, 2011 13:06
HTML Strip charfilter test for ElasticSearch
# Analyze text: "the <b>quick</b> bröwn <img src="fox"/> &quot;jumped&quot;"
curl -XPUT 'http://127.0.0.1:9200/foo/' -d '
{
"index" : {
"analysis" : {
"analyzer" : {
"test_1" : {
"char_filter" : [
"html_strip"
@didip
didip / supervisord-example.conf
Created January 30, 2011 05:10
Example configuration file for supervisord.conf
[unix_http_server]
file=/tmp/supervisor.sock ; path to your socket file
[supervisord]
logfile=/var/log/supervisord/supervisord.log ; supervisord log file
logfile_maxbytes=50MB ; maximum size of logfile before rotation
logfile_backups=10 ; number of backed up logfiles
loglevel=error ; info, debug, warn, trace
pidfile=/var/run/supervisord.pid ; pidfile location
nodaemon=false ; run supervisord as a daemon
@FSX
FSX / async_psycopg2.py
Created March 8, 2011 22:11
A module for asynchronous PostgreSQL queries in Tornado.
#!/usr/bin/env python
__author__ = 'Frank Smit <frank@61924.nl>'
__version__ = '0.1.0'
import functools
import psycopg2
from tornado.ioloop import IOLoop, PeriodicCallback
@dshaw
dshaw / application.js
Created June 8, 2011 17:43 — forked from fabware/application.js
socket.io application and haproxy configuration
var express = require('express');
var redis = require('redis');
const serverType = process.argv[2];
const serverHost = process.argv[3];
const serverPort = parseInt(process.argv[4]);
const redisPort = 6379;
const redisHost = '127.0.0.1';
@chrisroos
chrisroos / gpg-import-and-export-instructions.md
Created September 9, 2011 10:49
Instructions for exporting/importing (backup/restore) GPG keys

Every so often I have to restore my gpg keys and I'm never sure how best to do it. So, I've spent some time playing around with the various ways to export/import (backup/restore) keys.

Method 1

Backup the public and secret keyrings and trust database

cp ~/.gnupg/pubring.gpg /path/to/backups/
cp ~/.gnupg/secring.gpg /path/to/backups/
cp ~/.gnupg/trustdb.gpg /path/to/backups/

or, instead of backing up trustdb...

@samatjain
samatjain / jsonapiplugin-example.py
Created December 10, 2011 10:40
JSONAPIPlugin for Bottle
#!/usr/bin/env python
# Author: Samat Jain <http://samat.org/>
# License: MIT (same as Bottle)
import bottle
from bottle import request, response, route
from bottle import install, uninstall
@hrldcpr
hrldcpr / tree.md
Last active June 8, 2024 18:11
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!