This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
example.com { | |
reverse_proxy keycloak:8080 { | |
# https://github.com/keycloak/keycloak/issues/12682 | |
# x-csrftoken is set by the Swagger UI | |
header_down +Access-Control-Allow-Headers "x-csrftoken" | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
tar -cf - INPUT_DIR | xz -0e -c > OUTPUT_FILE.tar.xz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import logging | |
logging.basicConfig( | |
format="%(asctime)s %(levelname)s: %(message)s", | |
level=logging.getLevelName("INFO"), | |
) | |
logger = logging.getLogger() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"iconOff": "ic_power_settings_new", | |
"iconOn": "ic_power_switch", | |
"offColor": -10461088, | |
"onColor": -65536, | |
"payloadOff": "0", | |
"payloadOn": "1", | |
"enableIntermediateState": true, | |
"enablePub": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Just put this in your ~/.zshrc or ~/.bashrc! | |
# Pretty format of json files. Usage: jless path/to/file.json | |
function jless { | |
python -mjson.tool "$1" | pygmentize -l json | less -Nr | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# timestamps in trim filter can be used to sync the videos | |
# The duration of the first color filter specifies the length of the output video | |
# Scale / crop may be adjusted for the individual files | |
ffmpeg -i a.mp4 -i b.mp4 -i c.mp4 -filter_complex \ | |
"color= | |
d='02\:50\:00': | |
c=0x161618: | |
s='1366x768' |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from typing import Union, Dict | |
from rest_framework.viewsets import GenericViewSet | |
from rest_framework.serializers import BaseSerializer | |
class ActionSerializersMixin(object): | |
""" | |
Allows the usage of different serializer classes depending on the action. | |
When your `ViewSet` class is using this mixin, it should provide a `serializer_classes` attribute instead | |
of a `serializer_class` attribute. This attribute must be dict, which provides for every action name the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const {random, sin, PI, pow} = Math | |
this.t += 1 / 44100 | |
const freq = noteNumber => pow(2, (noteNumber-69) / 12) * 440 | |
const lowPass = (name, v, amount) => { | |
amount = amount ? amount : 1; | |
const val = (this[name] * amount + v) / (amount + 1) | |
this[name] = val; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import argparse | |
import csv | |
from datetime import datetime | |
from matplotlib import pyplot | |
import numpy as np | |
parser = argparse.ArgumentParser(description='Plot N26 CSV') | |
parser.add_argument('filepath', type=str, help='path to csv file downloaded from N26') | |
args = parser.parse_args() |
NewerOlder