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 | |
import sys | |
import logging | |
logger = logging.getLogger('wordsfrequency') | |
class WrongInputError(Exception): | |
pass |
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() { | |
// article voice synth | |
var SpeechGenerator = function() { | |
var that = this; | |
this.STATES = { STOP: 0, RUN: 1, PAUSE: 2 }; | |
this.chunkSize = 190; | |
this.$root = $('.content'); | |
this.subTitleClass = 'second_title'; | |
this.status = this.STATES.STOP; | |
this.language = 'ru-RU'; |
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() { | |
$('.biz-ex-search-input, .biz-ex-btn-search, .biz-ex-search').unbind(); | |
var $root = $('#search'), | |
$searchContainer = $('<ul>'), | |
$search = $root.find('.biz-ex-search-input'), | |
searchClassList = 'custom-ul ui-autocomplete ui-front ui-menu ui-widget ui-corner-all', | |
defaultSearchPlaceholder = 'Искать везде', | |
unicodeBoundaryStart = "(^\|[ \n\r\t.,'\"\+!?-]+)", |
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
class Node: | |
def __init__(self, value, next_item=None): | |
self.value = value | |
self.next = next_item | |
class LinkedList: | |
storage = [] | |
def __init__(self): |
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 rupluralize(value, endings): | |
try: | |
endings = endings.split(',') | |
if value % 100 in (11, 12, 13, 14): | |
return endings[2] | |
if value % 10 == 1: | |
return endings[0] | |
if value % 10 in (2, 3, 4): | |
return endings[1] | |
else: |
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
from __future__ import unicode_literals | |
import os | |
import re | |
import shutil | |
import threading | |
import warnings | |
import pymorphy2 | |
from django.conf import settings | |
from django.core.exceptions import ImproperlyConfigured |
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
<?php | |
libxml_use_internal_errors(true); | |
class Spider { | |
private $basicUrl = 'http://euroset.ru/'; | |
private $restrictedSectionTitles = []; | |
const SECTION_MOBILE = 1; | |
const SECTION_PAD = 2; | |
const SECTION_MOBILE_TITLE = 'Мобильные телефоны'; |
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
* spin -> adjust_hue | |
* @ -> $ | |
* ... | |
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
.old-browsers { | |
position: fixed; | |
top: 0; | |
left: 0; | |
right: 0; | |
background: #FCB3BC; | |
border-bottom: 5px solid #E1A0A8; | |
color: #000; | |
text-shadow: none; | |
text-align: center; |
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
class Number(models.Model): | |
MASKS = dict( | |
xyxy=r'(?:(\d)((?!\1)\d)\1\2)', | |
xyyx=r'(?:(\d)((?!\1)\d)\2\1)', | |
xxyy=r'(?:(\d)\1((?!\1)\d)\2)', | |
two_digits=lambda value, where: Number.match_two_digits(value), | |
sequence=lambda value, where: Number.match_sequence(value, where), | |
x0y0z0=r'(?:(\d)0((?!\1)\d)0((?!\1|\2)\d)0)', | |
xyzaxyz=r'(?:(\d)((?!\1)\d)((?!\1|\2)\d)\d\1\2\3)', | |
xyzxyza=r'(?:(\d)((?!\1)\d)((?!\1|\2)\d)\1\2\3\d)', |