Skip to content

Instantly share code, notes, and snippets.

View ssbb's full-sized avatar
🏠
Working from home

Sviatoslav Bulbakha ssbb

🏠
Working from home
View GitHub Profile
(require 'twittering-mode)
(twittering-enable-unread-status-notifier)
(setq twittering-use-master-password t)
(add-hook 'twittering-mode-hook
(lambda ()
(setq twittering-timer-interval 300)
(setq twittering-url-show-status nil)
(setq twittering-icon-mode nil)
<div class="slider hero__slider">
<input class="slider__input" type="radio" name="point" id="slide-1" checked />
<input class="slider__input" type="radio" name="point" id="slide-2" />
<input class="slider__input" type="radio" name="point" id="slide-3" />
<input class="slider__input" type="radio" name="point" id="slide-4" />
<input class="slider__input" type="radio" name="point" id="slide-5" />
<div class="slider__content">
<div class="slider__slide slider__slide--1"><img src="{{ static('temp/slide1.png') }}" class="slider__slide__image" /></div>
<div class="slider__slide slider__slide--2"><img src="{{ static('temp/slide2.png') }}" class="slider__slide__image" /></div>
class Base(object):
def process(self, s=''):
return s
class M1(object):
def process(self, *args, **kwargs):
s = super(M1, self).process(*args, **kwargs)
s += '_1_'
return s
{% extends "layout.html" %}
{% block body %}
<input type="text" id="interaction">
<input type="submit" value="submit" id="submit">
<script type="text/javascript" src="/static/js/jquery-1.11.1.min.js"></script>
<script type="text/javascript">
# -*- coding: utf-8 -*-
import random
class Dot(object):
def __init__(self, x, y):
self.coords = [x, y]
class Line(object):
def retry(times, *exception_types):
def try_it(func, *fargs, **fkwargs):
for i in xrange(times - 1):
try:
return func(*fargs, **fkwargs)
except exception_types or Exception:
pass
return func(*fargs, **fkwargs)
return try_it
import decorator
def retry(times, *exception_types):
@decorator.decorator
def try_it(func, *fargs, **fkwargs):
for i in xrange(times):
try:
return func(*fargs, **fkwargs)
except exception_types or Exception:
log(logger.debug, 'Getting browser instance...', {
'Proxy': proxy.proxy_ip,
'User-Agent': user_agent,
})
def log(func, message, data={}):
for k, v in data.items():
message += '\n\t %s: %%(%s)s' % (k, k)
if data:
return func(message, data)
return func(func)
browser.find_element_by_id('firstName').send_keys(first_name)
browser.find_element_by_id('lastName').send_keys(last_name)
browser.find_element_by_id('email').send_keys(email)
browser.find_element_by_id('emailRepeat').send_keys(email)
browser.find_element_by_id('skypeName').send_keys(username)
browser.find_element_by_id('password').send_keys(password)
browser.find_element_by_id('repeatPassword').send_keys(password)