This file contains 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 struct import pack | |
class Bitmap(): | |
def __init__(s, width, height): | |
s._bfType = 19778 # Bitmap signature | |
s._bfReserved1 = 0 | |
s._bfReserved2 = 0 | |
s._bcPlanes = 1 | |
s._bcSize = 12 | |
s._bcBitCount = 24 |
This file contains 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 bitmap import Bitmap | |
from random import choice, seed | |
BLACK = (0,0,0) | |
WHITE = (255,255,255) | |
class Automata(): | |
def __init__(s, rule, width=512): | |
s.cells = [False]*width |
This file contains 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 vk_api # Нужно установить эту библиотеку: pip install vk_api | |
from getpass import getpass as gp | |
def getChat(vk, id): | |
try: | |
r = vk.method('messages.getChat', {'chat_id': str(id)}) | |
except vk_api.exceptions.ApiError: | |
r = None | |
return r |
This file contains 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
git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
export PS1="[\u@\h \W]\[\033[00;32m\]\$(git_branch)\[\033[00m\]\$ " |
This file contains 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 sys import stdout | |
from time import sleep | |
def pr(s): | |
stdout.write(s) | |
stdout.flush() | |
def animate(v): |
This file contains 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 os | |
import time | |
from PIL import Image | |
def fullpage_screenshot(driver, file): | |
""" | |
Saves full page screenshot from selenium webdriver | |
Originally copied from https://stackoverflow.com/questions/41721734/take-screenshot-of-full-page-with-selenium-python-with-chromedriver | |
(c) ihightower |
This file contains 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
export ZSH="/home/pashawnn/.oh-my-zsh" | |
DEFAULT_USER=$USER | |
ZSH_THEME="agnoster" | |
COMPLETION_WAITING_DOTS="true" | |
plugins=( | |
git | |
pip | |
python | |
sudo | |
) |
This file contains 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
#include <windows.h> | |
#include <windowsx.h> | |
#include <cstdio> | |
#include <ctype.h> | |
#include <clocale> | |
#define ID_BUTTON 101 | |
HWND hEdit1; |