Skip to content

Instantly share code, notes, and snippets.

Avatar
🔥

Igor cra

🔥
View GitHub Profile
View cannot_reference_dunder_param.py
import functools
import time
from collections import abc
from typing import Callable, Optional, Union
Step = abc.Callable
def step(description: str) -> Step:
def _step(func):
View nginx.conf
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=my_cache:10m max_size=10g inactive=480m use_temp_path=off;
server { listen 80; listen [::]:80;
server_name edexp.club;
# Backend
location /api/ {
# rewrite ^/api(.*)$ $1 break;
proxy_pass http://localhost:5000/;
proxy_http_version 1.1;
View solve2.py
#!/bin/env python
from __future__ import annotations
import itertools
import pathlib
import operator
from typing import Dict, List, NamedTuple, Optional, Tuple, Union
View gist:e68fb303a7e6e6a4a231b8daf311f2b2
#!/usr/bin/env python2
from datetime import datetime as dt
import os
from dot3k import lcd
if __name__ == "__main__":
lcd.write(dt.now().strftime("%Y/%m/%d %H:%M"))
View example_bot_class.py
import requests
class Bot:
BASE_URL = 'https://api.telegram.org'
def __init__(self, token: str) -> None:
self.token = token
self.base_url = f'{self.BASE_URL}/bot{token}'
View curators_dict_2019.py
curators_dict = {
# andan
'a.fenin@letnyayashkola.org': {'workshop_slug': 'andan'},
'a.zhukova@letnyayasnkola.org': {'workshop_slug': 'andan'},
'm.servetnik@letnyayashkola.org': {'workshop_slug': 'andan'},
'e.rybina@letnyayashkola.org': {'workshop_slug': 'andan'},
'g.moroz@letnyayashkola.org': {'workshop_slug': 'andan'},
'e.kozhanova@letnyayashkola.org': {'workshop_slug': 'andan'},
# astrogeo
'k.vlasov@letnyayashkola.org': {'workshop_slug': 'astrogeo'},
View parse_pr0.py
to_parse = """
If (feature 1 <= 0.0690282131661442)
Predict: 0.0
Else (feature 1 > 0.0690282131661442)
Predict: 1.0
"""
def parse_this_shit(shit):
lines = [line.strip() for line in shit.split('\n')]
View DRUGS.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View Rotate_array.cpp
#include <iostream>
using namespace std;
void printArray(const int* const b, const unsigned size)
{
for (unsigned i = 0; i < size; i++)
cout<< b[i] << ' ';
cout << endl;
}
View test_copy.py
import copy
a = [1, 2, 3]
b = []
c_d = [15, 18, 20]
d_d = []
e_l = [4, 5, 6]
f_l = []