Skip to content

Instantly share code, notes, and snippets.

View DangerOnTheRanger's full-sized avatar

Kermit Alexander II DangerOnTheRanger

View GitHub Profile
@DangerOnTheRanger
DangerOnTheRanger / importhooks.py
Last active August 19, 2022 02:54
Example showing how to use import hooks in Python 3 - original article: https://dev.to/dangerontheranger/dependency-injection-with-import-hooks-in-python-3-5hap
import importlib.abc
import importlib.machinery
import sys
import types
class DependencyInjectorFinder(importlib.abc.MetaPathFinder):
def __init__(self, loader):
self._loader = loader
def find_spec(self, fullname, path, target=None):
@DangerOnTheRanger
DangerOnTheRanger / config
Created April 21, 2018 04:37
Polybar config
;=====================================================
;
; To learn more about how to configure Polybar
; go to https://github.com/jaagr/polybar
;
; The README contains alot of information
;
;=====================================================
[colors]
#!/usr/bin/env python3
import getpass
import random
MAX_GUESSES = 7
SCORE_FILENAME = "gamescores"
def genrandom(min_num, max_num):
OpenBlox Coding Standard
------------------------
Indentation
-----------
Indentation is done with tabs.
Each tab is the equivalent of 4 spaces, therefore, each tab is 4 spaces long.
Comments
import panzee.damage
def test_stats_default_values():
stats = panzee.damage.ModelStats()
assert stats.movement_cost == 1
assert stats.damage_reduction == 1.0
assert stats.max_ap == 100
assert stats.faint_threshold == 20