Skip to content

Instantly share code, notes, and snippets.

View vberlier's full-sized avatar

Valentin Berlier vberlier

  • Paris, France
View GitHub Profile
@vberlier
vberlier / magic.py
Last active February 5, 2019 07:31
A little example that demonstrates how far you can push metaclasses insanity in Python.
from functools import partial
from query import run_query
class QueryResolver(dict):
def __getitem__(self, key):
if key.lower().startswith('select_') and key not in self:
self[key] = partial(run_query, key)
return super().__getitem__(key)
@vberlier
vberlier / .travis.yml
Last active February 5, 2019 07:37
Travis configuration for publishing python packages using poetry
language: python
sudo: false
dist: xenial
cache:
pip: true
directories:
- $HOME/.cache/pypoetry
@vberlier
vberlier / Makefile
Last active September 7, 2019 23:43
Generic Makefile for C projects. Supports multiple source directories, with out-of-source release, debug and memcheck builds.
# Project info
EXEC_NAME := main
SRC_DIRS := src
BUILD_DIR := build
# General config
CFLAGS += -std=c18 -Wall -Wextra -Wconversion -Werror
CPPFLAGS += $(addprefix -I,$(SRC_DIRS))
diff --git a/youtube_dl/extractor/bandcamp.py b/youtube_dl/extractor/bandcamp.py
index f14b407..72693b4 100644
--- a/youtube_dl/extractor/bandcamp.py
+++ b/youtube_dl/extractor/bandcamp.py
@@ -1,5 +1,6 @@
from __future__ import unicode_literals
+import json
import random
import re
@function_tag minecraft:load
{
"values": [
"default:load"
]
}
@function_tag minecraft:tick
{
"values": [
say hello