Skip to content

Instantly share code, notes, and snippets.

View LevBravE's full-sized avatar

LevBravE LevBravE

  • Russia, Moscow
View GitHub Profile
@LevBravE
LevBravE / generate_tm.py
Last active August 29, 2015 14:22
Proxy Server™
# -*- coding: utf-8 -*-
"""
Install twisted (pip install twisted) and run the script.
Небольшой прокси сервер ловящий html контент страницы и модифицирующий его
добаляя после каждого слова состоящего из шести симвалов - ™
Проверенно на Firefox
В настройках Firefox необходимо задать:
HTTP Proxy -> localhost
@LevBravE
LevBravE / verbatim_templatetag.py
Created December 7, 2012 06:48 — forked from paulsmith/verbatim_templatetag.py
verbatim Django template tag
"""
jQuery templates use constructs like:
{{if condition}} print something{{/if}}
This, of course, completely screws up Django templates,
because Django thinks {{ and }} mean something.
Wrap {% verbatim %} and {% endverbatim %} around those
blocks of jQuery templates and this will try its best
@LevBravE
LevBravE / fuelup.py
Created January 11, 2018 08:51
Пример подписи запросов для доступа к FuelUP сервису
import os
import requests
import time
import random
import logging
import sqlite3
import json
from Crypto.PublicKey import RSA
from Crypto.Signature import PKCS1_v1_5
This file has been truncated, but you can view the full file.
-- Еh bien, mon prince. Gênes et Lucques ne sont plus que des apanages,
des поместья, de la famille Buonaparte. Non, je vous préviens, que si vous
ne me dites pas, que nous avons la guerre, si vous vous permettez encore de
pallier toutes les infamies, toutes les atrocités de cet Antichrist (ma
parole, j'y crois) -- je ne vous connais plus, vous n'êtes plus mon ami,
vous n'êtes plus мой верный раб, comme vous dites. [1] Ну,
здравствуйте, здравствуйте. Je vois que je vous fais peur, [2]
садитесь и рассказывайте.
Так говорила в июле 1805 года известная Анна Павловна Шерер, фрейлина и
приближенная императрицы Марии Феодоровны, встречая важного и чиновного
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 1 column, instead of 3. in line 1.
keywords;price;product_name
МОРУМ, Ковер, безворсовый;6999;МОРУМ
МОРУМ, Ковер, безворсовый;6999;МОРУМ
ИДБИ, Придверный коврик;649;ИДБИ
ХОДДЕ, Ковер, безворсовый;1399;ХОДДЕ
ОПЛЕВ, Придверный коврик;599;ОПЛЕВ
ОПЛЕВ, Придверный коврик;599;ОПЛЕВ
ЮНКЭН, Брикеты;89;ЮНКЭН
БУНСЁ, Детское садовое кресло;1199;БУНСЁ
ИКЕА ПС ВОГЭ, Садовое легкое кресло;1999;ИКЕА ПС ВОГЭ
This file has been truncated, but you can view the full file.
WHITE = 1
BLACK = 2
# Удобная функция для вычисления цвета противника
def opponent(color):
if color == WHITE:
return BLACK
else:
return WHITE
import pygame
size = width, height = (400, 300)
screen = pygame.display.set_mode(size)
pygame.init()
def draw():
screen.fill((0, 0, 0))
font = pygame.font.Font(None, 50)
import pygame
size = width, height = 301, 301
screen = pygame.display.set_mode(size)
running = True
x_pos = 0
while running:
# внутри игрового цикл еще один цикл
# приема и обработки сообщений
import pygame
import random
def draw():
for i in range(10000):
screen.fill(pygame.Color('white'), (random.random() * width, random.random() * height, 1, 1))
size = width, height = 301, 301