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 sqlalchemy import Index, Column, ForeignKey, Integer, String | |
from sqlalchemy.orm import relationship | |
class Node(Base): | |
id = Column(Integer, primary_key=True, index=True) | |
parent_id = Column(ForeignKey("node.id"), nullable=True) | |
name = Column(String(256), index=False, nullable=False) | |
__table_args__ = ( | |
Index("ix_node_parent", id, parent_id, unique=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
#!/usr/bin/env bash | |
# Installs NixOS on a Hetzner server, wiping the server. | |
# | |
# This is for a specific server configuration; adjust where needed. | |
# | |
# Prerequisites: | |
# * Update the script wherever FIXME is present | |
# | |
# Usage: |
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 re | |
from jinja2.filters import environmentfilter, make_attrgetter, ignore_case | |
@environmentfilter | |
def sort_alphanum(environment, value, reverse=False, case_sensitive=False, attribute=None): | |
""" | |
https://blog.codinghorror.com/sorting-for-humans-natural-sort-order/ | |
Extended use in jinja2 | |
""" |
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
# install deps | |
apt update && apt install libxpm-dev | |
phpbrew update | |
phpbrew install -j $((nproc + 1)) 7.4 +default +json +gd +ctype +dom +openssl +iconv +zip +xml +hash +mbstring +fpm +mysql +intl | |
phpbrew ext install redis stable | |
phpbrew ext install opcache stable | |
phpbrew ext install gd -- \ | |
--enable-gd-native-ttf \ | |
--with-gd=shared \ |
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
package de.retarus.edi.gate.filter; | |
import com.google.common.io.ByteStreams; | |
import javax.servlet.ReadListener; | |
import javax.servlet.ServletInputStream; | |
import javax.servlet.http.HttpServletRequest; | |
import javax.servlet.http.HttpServletRequestWrapper; | |
import java.io.BufferedReader; | |
import java.io.ByteArrayInputStream; | |
import java.io.IOException; |