Skip to content

Instantly share code, notes, and snippets.

View andehpants's full-sized avatar
🐢
Slow and steady

andehpants

🐢
Slow and steady
View GitHub Profile
@Querijn
Querijn / ddragon_example.js
Last active November 20, 2025 21:39
Get Champion by key or by ID with the latest DDragon version (Javascript)
let championByIdCache = {};
let championJson = {};
async function getLatestChampionDDragon(language = "en_US") {
if (championJson[language])
return championJson[language];
let response;
let versionIndex = 0;
@jonseymour
jonseymour / aemo_nmi_checksum.py
Last active January 31, 2022 10:48
AEMO NMI checksum calculator
from itertools import chain
# Calculates the AEMO NMI checksum according to:
#
# https://www.aemo.com.au/Electricity/National-Electricity-Market-NEM/Retail-and-metering/-/media/EBA9363B984841079712B3AAD374A859.ashx
#
# Always calculates the checksum with the 10 left-most digits if supplied with
# a 10 or 11 character string. Unspecified results occur for inputs of other lengths.
#
@wojteklu
wojteklu / clean_code.md
Last active March 20, 2026 14:45
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules