Skip to content

Instantly share code, notes, and snippets.

@pintman
pintman / config.js
Last active June 12, 2018 13:38
MagicMirror - sample config.
/* Magic Mirror Config Sample
*
* By Michael Teeuw http://michaelteeuw.nl
* MIT Licensed.
*
* For more information how you can configurate this file
* See https://github.com/MichMich/MagicMirror#configuration
*
*/
@pintman
pintman / channel.py
Created August 16, 2018 06:00
FlipDotHero - minigamejam in Dortmund (2018-08-05)
import math
import time
import random
import levels
try:
import rogueflip
import pygame
except ImportError as e:
print("Unable to import pygame or rogueflip. \
Some games may not be runnable!", e)
@pintman
pintman / runtime_analysis.py
Last active October 31, 2018 09:14
Linear, polynomial and exponential runtime analysis.
import time
WAIT_TIME = 0.001 # seconds
MAX = 10
def do_something_time_comsuming():
time.sleep(WAIT_TIME)
def linear(n):
@pintman
pintman / gatter.py
Last active November 22, 2021 11:20
from abc import ABC, abstractmethod
# abc = abstract base class
# Klassen, die von ABC erben, sind selbst abstrakt
class BaseGate(ABC):
# Deklaration einer abstrakten Methode
@abstractmethod
def perform(self) -> bool:
...
import urllib.request
import datetime
def download(url):
"""
Download and return data from the given URL.
"""
data = urllib.request.urlopen(url).read()
return data