Skip to content

Instantly share code, notes, and snippets.

View henry232323's full-sized avatar
🙂
:)

Henry henry232323

🙂
:)
View GitHub Profile
import random; _1, ___1, __1, ___________1, ____1, ___, _, __, ___________, __1_, __1_1 = [random.randint(0, 24) for _ in range(11)]
hello_world = \
1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 111 +\
1 |__1 | ___ | 1_1 | ___ | 1 | 1 |_| ___________ |_| __| 1 \
| __ | 1^_^1 | 1 | 1 | _ | 1 | 1 | 1 | 1^_^1 | __| 1_1 | _ | \
1 | 1 | 1^ __| 1 | 1_1 | (_) | 1 |__1_|__1_1 | (_) | 1 | 1_1 | (_) | \
1_1 |_1 |___1 |_1 |_1 |___1 |___________1 |___1 |_1 |_1 |____1
if hello_world == 127:
print("Hello World!")
@henry232323
henry232323 / async_stdin.py
Last active September 6, 2017 02:02
Using sys.stdin with asyncio readers. Doesn't work on Windows because sys.stdin isn't a socket
import sys
import asyncio
from collections import deque
_loop = asyncio.get_event_loop()
_queue = deque()
def __reader(self):
from types import coroutine
from collections import deque
from heapq import heappop, heappush
from traceback import print_exc
from inspect import iscoroutine
import time
@coroutine
def ayield():
from discord.ext import commands
import discord
from random import randint, choice, sample
import asyncio
from math import ceil
games_example = {
"channel obj": { # channel ids
"state": 0, # 0: lobby, 1: in progress, 2: cancelled
"owner": "asdsadd",
from discord.ext import commands
import resistance
class Bot(commands.Bot):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.add_cog(resistance.Resistance(self))
from threading import Thread
from queue import Queue, Empty
from subprocess import *
from enum import Enum
from collections import defaultdict
ESCAPE = "\u001b"
class EventEnum(Enum):
cpu = "CPU"
#!/usr/bin/python
from http.server import BaseHTTPRequestHandler,HTTPServer
PORT_NUMBER = 80
#This class will handles any incoming request from
#the browser
class myHandler(BaseHTTPRequestHandler):
#Handler for the GET requests
import numpy as np
import math
from matplotlib.pyplot import quiver
import matplotlib.pyplot as plt
nodes = []
kc = 8.99 * 10 ** 9
ec = 1.60217662 * 10 ** (-19)
# x, y, charge
import math
class Graph:
def __init__(self):
self.edges = []
self.nodes = []
def add_edge(self, key1, key2, w):
for node in self.nodes:
if node.key == key1: