This file contains hidden or 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
import random | |
import sys | |
import re | |
def mix_word(s): | |
if len(s) < 3: | |
return s | |
middle = list(s[1:-1]) | |
random.shuffle(middle) |
This file contains hidden or 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
d = {} | |
for i, v in enumerate('zero one two three four five six seven eight nine ten eleven twelve thirteen'.split()): | |
d[v] = i | |
for v, i in d.items(): | |
if 3 < i < 10: | |
d[v + 'teen'] = i + 10 | |
d.update({ |
This file contains hidden or 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
def get_emails(): | |
emails = {} | |
with open('list.txt', 'r') as f: | |
lines = f.readlines() | |
for l in lines: | |
l = l.strip() | |
if '@' in l: | |
a, d = l.split('@') | |
if d: | |
if d in emails: |
This file contains hidden or 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
function clean_title($s, $max_chars=64) { | |
$result = ''; | |
$arr = str_split($s); | |
$allowed_chars = str_split('0123456789"(),.:;- йцукенгшщзхъфывапролджэёячсмитьбюqwertyuiopasdfghjklzxcvbnm'); | |
foreach ($arr as $char) { | |
if (len($result) >= $max_chars) { | |
break; | |
} | |
if (in_array(strtolower($char), $allowed_chars)) { | |
$result += $char; |
This file contains hidden or 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
def apply_cid(obj): | |
cids = models.CallerId.objects.filter(extension=obj).all() | |
for c in cids: | |
c.status = 1 | |
c.save() | |
class CidInLineAdmin(admin.TabularInline): | |
model = model.CallerId | |
extra = 0 |
This file contains hidden or 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
// увидишь советника — убей советника | |
document.body.addEventListener('DOMNodeInserted', function (e) { | |
if (e.target.innerHTML && e.target.innerHTML.indexOf('Советник Яндекс.Маркета') > -1) { | |
console.log('svt.killed:', e.target.id); | |
localStorage['svt.killed'] = true; | |
e.target.remove(); | |
} | |
}); |
This file contains hidden or 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
// увидишь советника — убей советника | |
$(function() { | |
var interval = 250, | |
attempts = 20, | |
kill = function() { | |
var $btn = $('[title="Предложения других магазинов"]'); | |
if ($btn.length > 0) { | |
var $block = $btn.parent().parent(), | |
h = $block.height(); | |
console.log('kill:', $block); |
This file contains hidden or 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
amqp==1.4.9 | |
antigate==1.4.0 | |
anyjson==0.3.3 | |
appnope==0.1.0 | |
Babel==2.3.4 | |
backports.shutil-get-terminal-size==1.0.0 | |
backports.ssl==0.0.9 | |
beautifulsoup4==4.5.1 | |
billiard==3.3.0.23 | |
boto==2.42.0 |
This file contains hidden or 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
crawler.py http://cython.readthedocs.io | |
crawler INFO crawler.py:104 load index start | |
crawler INFO crawler.py:116 load index done | |
crawler DEBUG crawler.py:247 start http://cython.readthedocs.io | |
crawler DEBUG crawler.py:259 url http://cython.readthedocs.io found | |
crawler DEBUG crawler.py:247 start http://cython.readthedocs.io_static/nature.css | |
crawler DEBUG crawler.py:222 url fetch http://cython.readthedocs.io_static/nature.css | |
crawler DEBUG crawler.py:247 start http://cython.readthedocs.io_static/pygments.css | |
crawler DEBUG crawler.py:222 url fetch http://cython.readthedocs.io_static/pygments.css | |
crawler DEBUG crawler.py:247 start http://cython.readthedocs.io_static/favicon.ico |
This file contains hidden or 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 | |
# -*- coding: utf-8 -*- | |
import string | |
import requests | |
import sys | |
MASKS = { | |
'*': u'йцукенгшщзхъфывапролджэячсмитьбюё' + string.digits + string.lowercase | |
} |
NewerOlder