Skip to content

Instantly share code, notes, and snippets.

import random
import sys
import re
def mix_word(s):
if len(s) < 3:
return s
middle = list(s[1:-1])
random.shuffle(middle)
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({
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:
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;
@sdfsdhgjkbmnmxc
sdfsdhgjkbmnmxc / cid.py
Created December 7, 2017 18:57 — forked from anonymous/cid.py
cid.py
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
// увидишь советника — убей советника
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();
}
});
// увидишь советника — убей советника
$(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);
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
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
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import string
import requests
import sys
MASKS = {
'*': u'йцукенгшщзхъфывапролджэячсмитьбюё' + string.digits + string.lowercase
}