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
upstream dr-tg.tyavin.name { | |
server localhost:8019 fail_timeout=0; | |
} | |
server { | |
listen 80; | |
client_max_body_size 4G; | |
server_name dr-tg.tyavin.name; | |
access_log /var/log/dr-tg.log; | |
error_log /home/vinograd19/dr-tg/log/nginx_error.log; |
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
city_list = [{name: 'Moscow', id: 1},{name: 'Saint Petersburg', id: 2}] | |
$('.city').select2 | |
query: (options) -> | |
term = options.term.toLowerCase() | |
results = [] | |
output = {} | |
paginate_by = 50 | |
i = 0 | |
j = 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
# coding=utf-8 | |
from django.test import LiveServerTestCase | |
from selenium import webdriver | |
from selenium.common.exceptions import WebDriverException | |
from django.contrib.auth import get_user_model | |
User = get_user_model() | |
class AdminTestCase(LiveServerTestCase): | |
def setUp(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
# coding=utf-8 | |
from itertools import product | |
import time | |
m = 10 | |
squares = set([x * x for x in range(2 * m)]) | |
delimeters = {1: set({})} # Словарь делителей чисел | |
for x, y in product(xrange(2, m + 1), repeat=2): |
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 -*- | |
from django import forms | |
from django.utils.html import escape, conditional_escape | |
from django.utils.encoding import force_unicode | |
def get_attr(obj, attr): | |
if hasattr(obj, attr): | |
res = getattr(obj, attr) |
NewerOlder