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
String.prototype.format = function() { | |
var i = -1, args = arguments; | |
return this.replace(/#\{(.*?)\}/g, function(one, two) { | |
return (typeof args[0] == 'object')?args[0][two]:args[++i]; | |
}); | |
} | |
var thing = 'world!'; |
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
[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
[].forEach.call(document.querySelectorAll('form'), function (input) { | |
var table = []; | |
console.group('HTMLForm "' + input.name + '": ' + input.action); | |
console.log('Element: ', input, '\nName: ' + | |
input.name + '\nMethod: ' + input.method.toUpperCase() + | |
'\nAction: ' + input.action || 'null'); | |
['input', 'textarea', 'select'].forEach(function (control) { | |
[].forEach.call(input.querySelectorAll(control), function (node) { |
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
// formCheck - global variable token from page | |
// Enter in prompt articles url with new line delemiter | |
var _add = function (url){ | |
$.ajax({ | |
url: 'http://getpocket.com/a/x/itemAction.php' | |
,data:{ | |
action: 'add' | |
,formCheck: formCheck | |
, url: url | |
} |
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 |
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
class HomeController < ApplicationController | |
def contacts | |
UserMailer.notify_email( params[:text]).deliver | |
end | |
end |
OlderNewer