This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
tc.constraint_name, tc.table_name, kcu.column_name, | |
ccu.table_name AS foreign_table_name, | |
ccu.column_name AS foreign_column_name | |
FROM | |
information_schema.table_constraints AS tc | |
JOIN information_schema.key_column_usage AS kcu ON tc.constraint_name = kcu.constraint_name | |
JOIN information_schema.constraint_column_usage AS ccu ON ccu.constraint_name = tc.constraint_name | |
WHERE constraint_type = 'FOREIGN KEY' AND tc.table_name='ИМЯ ТАБЛИЦЫ'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import sys | |
from psycopg2 import connect | |
from DBSingleStyle import Param, to_format | |
if __name__=='__main__': | |
query = ('SELECT table_name, column_name, data_type \ | |
FROM information_schema.columns WHERE table_name=', Param(sys.argv[1])) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
autoload -U compinit | |
compinit -C | |
zstyle ':completion:*' menu yes select | |
zstyle ':completion:*:(ssh|scp):*:users' ignored-patterns `cat /etc/passwd | awk -F ":" '{ if($3<1000) print $1 }'` | |
zstyle ':completion:*:processes' command 'ps xua' | |
zstyle ':completion:*:processes' sort false | |
zstyle ':completion:*:processes-names' command 'ps xho command' | |
zstyle ':completion:*:*:kill:*:processes' list-colors '=(#b) #([0-9]#)*=0=01;31' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from servers import fastcgi | |
import os | |
from jsonrpcstaff import ServiceHandler, configLogger | |
import logging | |
configLogger(level=logging.DEBUG) | |
class Service(object): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
import sys | |
import logging | |
import os | |
from os import path | |
logger = logging.getLogger(__name__) | |
def prepare_dir(filename): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Script for starting multiple fcgi instance. | |
# Count of instances is first argument of script. | |
PARAMS="runfcgi method=threaded daemonize=yes errlog=errlog.log workdir=./" | |
case $2 in | |
"start") | |
if [ $1 -le 1 ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
from random import random | |
letters_map={ | |
0:u'а', | |
1:u'б', | |
2:u'в', | |
3:u'г', | |
4:u'д', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var Key = new Class({ | |
initialize:function(symbol, handler){ | |
this.symbol = symbol; | |
this.handler = handler; | |
}, | |
render:function(){ | |
return new Element('a',{ | |
'href':'#', | |
'text':this.symbol, | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Дизъюктивная нормальная форма | |
hook for merkurial | |
threaded map (python, groovy) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
class MultiValueDict(dict): | |
""" | |
Словарь с возможностью соответствия | |
нескольких значений одному ключу. | |
>>> list_ = (('foo','bar'),('spam','eggs'),('foo','baz')) | |
>>> md = MultiValueDict(list_) | |
>>> md['foo'] | |
['bar', 'baz'] |