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 -*- | |
# Портирован с Java по мотивам http://www.algorithmist.ru/2010/12/porter-stemmer-russian.html | |
import re | |
class Porter: | |
PERFECTIVEGROUND = re.compile(u"((ив|ивши|ившись|ыв|ывши|ывшись)|((?<=[ая])(в|вши|вшись)))$") | |
REFLEXIVE = re.compile(u"(с[яь])$") | |
ADJECTIVE = re.compile(u"(ее|ие|ые|ое|ими|ыми|ей|ий|ый|ой|ем|им|ым|ом|его|ого|ему|ому|их|ых|ую|юю|ая|яя|ою|ею)$") | |
PARTICIPLE = re.compile(u"((ивш|ывш|ующ)|((?<=[ая])(ем|нн|вш|ющ|щ)))$") | |
VERB = re.compile(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
money() { | |
to=${3:-rub} | |
from=${2:-usd} | |
count=${1:-1} | |
wget -qO- "http://www.google.com/finance/converter?a=$count&from=$from&to=$to" | sed '/res/!d;s/<[^>]*>//g'; | |
} | |
alias m='money' |
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
money() { | |
node <<EOF | |
const http = require('http'); | |
const url = 'http://data.fixer.io/api/latest?access_key=API_KEY'; | |
http.get(url, (res) => { | |
res.setEncoding('utf8'); | |
let body = ''; | |
res.on('data', (data) => { | |
body += data; | |
}); |
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
encrypt() { | |
echo -n "$1" | openssl enc -e -aes-256-cbc -a -salt | |
} | |
decrypt (){ | |
echo "$1" | openssl enc -e -aes-256-cbc -a -d -salt | |
} |
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
let RVRE = /^(.*?[аеиоуыэюя])(.*)$/; | |
let PERFECTIVEGROUND_1 = /(ив|ивши|ившись|ыв|ывши|ывшись)$/; | |
let PERFECTIVEGROUND_2 = /([ая])(в|вши|вшись)$/; | |
let REFLEXIVE = /(с[яь])$/; | |
let ADJECTIVE =/(ее|ие|ые|ое|ими|ыми|ей|ий|ый|ой|ем|им|ым|ом|его|ого|ему|ому|их|ых|ую|юю|ая|яя|ою|ею)$/; | |
let PARTICIPLE_1 = /(ивш|ывш|ующ)$/; | |
let PARTICIPLE_2 = /([ая])(ем|нн|вш|ющ|щ)$/; | |
let VERB_1 = /(ила|ыла|ена|ейте|уйте|ите|или|ыли|ей|уй|ил|ыл|им|ым|ен|ило|ыло|ено|ят|ует|уют|ит|ыт|ены|ить|ыть|ишь|ую|ю)$/; | |
let VERB_2 = /([ая])(ла|на|ете|йте|ли|й|л|ем|н|ло|но|ет|ют|ны|ть|ешь|нно)$/; | |
let NOUN = /(а|ев|ов|ие|ье|е|иями|ями|ами|еи|ии|и|ией|ей|ой|ий|й|иям|ям|ием|ем|ам|ом|о|у|ах|иях|ях|ы|ь|ию|ью|ю|ия|ья|я)$/; |
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
money() { | |
to=${3:-rub} | |
from=${2:-usd} | |
count=${1:-1} | |
wget -qO- "http://www.google.com/finance/converter?a=$count&from=$from&to=$to" | sed '/res/!d;s/<[^>]*>//g'; | |
} | |
alias m='money' |
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
[user] | |
name = Kein | |
email = | |
[alias] | |
st = status | |
unstage = rm --cached | |
hist = log --pretty='format:%h - %an, %ar : %s' --graph | |
h = log --pretty='format:%Cred%h%Creset %C(yellow)%d%Creset - %s %C(green)%ar%Creset %C(blue)%an%Creset' --graph --all --decorate | |
ci = commit -m | |
co = checkout |
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
#!/usr/bin/env python | |
import sys | |
terse = "-t" in sys.argv[1:] or "--terse" in sys.argv[1:] | |
for i in range(2 if terse else 10): | |
for j in range(30, 38): | |
for k in range(40, 48): | |
if terse: | |
print "\33[%d;%d;%dm%d;%d;%d\33[m " % (i, j, k, i, j, k), | |
else: |
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
#!/usr/bin/python2.7 | |
import socket | |
import sys | |
import DNS | |
import cgi | |
arg = cgi.FieldStorage() | |
if "debug" in arg: | |
debug = True |
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
ssh_mount_dir='servers/' | |
export TERM=xterm-256color | |
export EDITOR="vim" | |
export CDPATH=:..:~/$ssh_mount_dir:~ | |
if [[ $- != *i* ]] ; then | |
return | |
fi |
NewerOlder