Skip to content

Instantly share code, notes, and snippets.

Avatar

Batuhan Taskaya isidentical

View GitHub Profile
View minemore.py
import random
import shutil
from collections import UserList, deque
from dataclasses import dataclass, field
from enum import Enum, auto
from typing import Dict, Tuple
Blocks = Enum("Blocks", "AIR GOLD COAL LAPIS EMERALD")
BOOST_AMOUNT = 0.1
View sub.c
#define ENSURE_CONSTANT(NODE) \
if ((NODE) != NULL && (NODE)->kind != Constant_kind) \
return 1;
#define GET_CONSTANT(NODE) (((NODE) != NULL) ? (NODE)->v.Constant.value : NULL)
static int
fold_subscr(expr_ty node, PyArena *arena, int optimize)
{
PyObject *newval, *key;
View handle_issue_comment.py
@defer.inlineCallbacks
def handle_issue_comment(self, payload, event):
changes = []
comment = payload["comment"]["body"].split()
log.msg(f"Handled comment: {comment}")
if payload.get("action") != "created": # should we support edits?
return ([], "git")
if len(comment) < 2 and comment[0] != f"@{BOT}":
View tombala.py
L1 = dict.fromkeys("1 21 45 62 70".split())
L2 = dict.fromkeys("17 39 50 73 81".split())
L3 = dict.fromkeys("4 28 48 65 90".split())
LINES = (L1, L2, L3)
completed_lines = set()
while len(completed_lines) != 3:
num = input("Next > ")
for n, line in enumerate(LINES, 1):
View keybase.md

Keybase proof

I hereby claim:

  • I am isidentical on github.
  • I am btaskaya (https://keybase.io/btaskaya) on keybase.
  • I have a public key ASDPYuTq-B_f8wQnVf-iNaoPNp-KqN-o0_yuezjTrkIYLAo

To claim this, I am signing this object:

View random_episode.py
from __future__ import annotations
import random
import webbrowser
from contextlib import suppress
from dataclasses import asdict, dataclass, replace
from enum import Enum
from html.parser import HTMLParser
from typing import Optional
View random_episode.py
from __future__ import annotations
import random
import webbrowser
from contextlib import suppress
from dataclasses import asdict, dataclass, replace
from enum import Enum
from html.parser import HTMLParser
from typing import Optional
View client.py
import subprocess
import json
import urllib.request
URL = "https://challange.oyk2019.ml"
def _find_author(filename, lineno):
prop = subprocess.check_output(f"git blame -pL {lineno},{lineno} {filename}", shell = True)
lines = prop.decode().split("\n")
commit = lines[0].split()[0]
View obtain.py
import subprocess
import shelve
def _find_author(filename, lineno):
prop = subprocess.check_output(f"git blame -pL {lineno},{lineno} {filename}", shell = True)
lines = prop.decode().split("\n")
commit = lines[0].split()[0]
author = lines[1].split()[1]
return commit, author