Skip to content

Instantly share code, notes, and snippets.

View fabyr's full-sized avatar

fabyr fabyr

  • Germany
  • 08:53 (UTC +02:00)
View GitHub Profile
@fabyr
fabyr / gitea_downgrade_1.24-1.22.sql
Created October 16, 2025 07:41
Gitea Database downgrade from v1.24 to v1.22 for forgejo migration
-- In part (migrations up to 11) taken from
-- https://gist.github.com/hinrikus/918a1d3ccb8daa22f5c2fa4b0ee0048f and extended for v1.24
-- Only tested with postgres.
-- NOTE: This will result in data loss for some tables. (see dropped columns and tables below)
-- Dangerous. Do not use in production.
-- Gitea v1.24 -> v1.22
BEGIN TRANSACTION;
@fabyr
fabyr / Huh?
Created June 27, 2024 19:32
Javascript?
[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]][([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([][[]]+[])[+!+[]]+(![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+[]]+([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+(!![]+[])[+!+[]]]((!![]+[])[+!+[]]+(!![]+[])[!+[]+!+[]+!+[]]+(!![]+[])[+[]]+([][[]]+[])[+[]]+(!![]+[])[+!+[]]+([][[]]+[])[+!+[]]+(+[![]]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+!+[]]]+(!![]+[])[!+[]+!+[]+!+[]]+(+(!+[]+!+[]+!+[]+[+!+[]]))[(!![]+[])[+[]]+(!![]+[][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]])[+!+[]+[+[]]]+([]+[])[([][(![]+[])[+[]]+(![]+[])[!+[]+!+[]]+(![]+[])[+!+[]]+(!![]+[])[+[]]]+[])[!+[]+!+[]+!+[]]+(!![]+[][(!
@fabyr
fabyr / path-simplify-re.py
Created July 16, 2023 22:09
Unnecessarily complicated canonical path with regex in python
import re
def simplify_path(path):
if path.endswith('/'):
path = path[:-1]
path = path[1:]
path = re.sub("/+?([^/]|$)", "/\g<1>", path)
path = re.sub("(^|/)\.(?=(/|$))", "/", path)