Skip to content

Instantly share code, notes, and snippets.

View bmispelon's full-sized avatar

Baptiste Mispelon bmispelon

View GitHub Profile
@bmispelon
bmispelon / test_enums.py
Created October 27, 2020 18:17 — forked from hjwp/test_enums.py
Better string enums
import random
from enum import Enum, EnumMeta, IntEnum
class GoatEnumMeta(EnumMeta):
def __getitem__(cls, item):
if isinstance(item, int):
item = cls._member_names_[item]
return super().__getitem__(item)
@bmispelon
bmispelon / EU001.py
Last active August 29, 2015 14:27 — forked from pinike01/EU001.py
Project Euler
#Problem number 1 at https://projecteuler.net/problem=1#
print(sum(i for i in range(1000) if i % 3 == 0 or i % 5 == 0))
@bmispelon
bmispelon / map.geojson
Last active December 22, 2015 21:09 — forked from anonymous/map.geojson
via:geojson.io
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.