Skip to content

Instantly share code, notes, and snippets.

View xjcl's full-sized avatar
👋
Say hi to me!

Jan-Frederik Konopka xjcl

👋
Say hi to me!
  • Düsseldorf, Germany
View GitHub Profile
import requests
import asyncio
import aiohttp
import aiofiles
get_img_url = lambda i: 'https://cdn.discordapp.com/embed/avatars/' + str(i) + '.png'
def download_all_sync():
@xjcl
xjcl / codejam_2018_r1b_a.py
Created April 26, 2021 12:06
Google Code Jam -- Rounding Error -- Solution in Python
# usage: (python3 a.py < a.in) > a.out
import time, sys, inspect, platform
print = lambda *a, **k: __builtins__.print(str(inspect.currentframe().f_back.f_lineno)+':',
*a, file=sys.stderr, **k) if platform.node() in ['surfux', 'ssd'] else ...
#---------------------------------------------
'''
i know this is 'sort-by-goodness'
@xjcl
xjcl / codejam_2020_r1b_b.py
Last active April 26, 2021 13:02
Google Code Jam -- Blindfolded Bullseye -- Solution in Python
# usage: (python3 a.py < a.in) > a.out
import time, sys, inspect, platform
print = lambda *a, **k: __builtins__.print(str(inspect.currentframe().f_back.f_lineno)+':',
*a, file=sys.stderr, **k) if platform.node() in ['surfux', 'ssd'] else ...
class EndTestCase(Exception): pass
#---------------------------------------------
@xjcl
xjcl / shitty_pong.py
Last active June 8, 2021 12:50
A simple pong game written in python and pyglet.
"""
Play a simple game of pong in a window.
Player 0 controls: (W, S) Player 1 controls: (O, L). Quit: (Q)
The ball bounces differently if you move while hitting it.
This also includes a slight factor of randomness.
Requires: pyglet, 10x10 image in directory: "white_square.png"
"""