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 ProjectAdmin(admin.ModelAdmin): | |
| filter_horizontal = 'kns', | |
| admin.site.register(Project, ProjectAdmin) |
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 django.contrib import admin | |
| from models import * | |
| class ProjectAdmin(admin.ModelAdmin): | |
| filter_horizontal = 'kns', | |
| admin.site.register(Project, ProjectAdmin) | |
| admin.site.register(Agreement) |
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
| /* jshint node:true */ | |
| 'use strict'; | |
| // generated on 2015-01-26 using generator-gulp-webapp 0.2.0 | |
| var gulp = require('gulp'); | |
| var $ = require('gulp-load-plugins')(); | |
| gulp.task('styles', function () { | |
| return gulp.src('app/styles/main.less') | |
| .pipe($.plumber()) | |
| // .pipe($.rubySass({ |
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
| * Правки | |
| ** Альты картинкам | |
| ** Строка 22 - класс можно через точку | |
| ** Второй комментарий должен быть с отступом. может сделать класс | |
| ** Поля формы - отдельный классы не нужны |
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
| 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) |
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 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) |
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
| log(logger.debug, 'Getting browser instance...', { | |
| 'Proxy': proxy.proxy_ip, | |
| 'User-Agent': user_agent, | |
| }) |
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 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: |
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 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 |
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
| # -*- coding: utf-8 -*- | |
| import random | |
| class Dot(object): | |
| def __init__(self, x, y): | |
| self.coords = [x, y] | |
| class Line(object): |