Skip to content

Instantly share code, notes, and snippets.

View Xennis's full-sized avatar

Fabian Rosenthal Xennis

View GitHub Profile
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: LaTeX_clean.bat
:: Source: https://gist.github.com/Xennis/dbfc0f0ace304d1f76f2
::
:: Based on Git ignore list:
:: http://xennis.org/wiki/Git_-_Ignore#LaTeX
:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
:: Generated files
del *.aux
###############################################################################
# LaTeX custom auto completion list
#
# for the LaTeX editor [Texmaker](http://www.xm1math.net/texmaker/):
# ´User´ > ´Customize Completion´
#
###############################################################################
## For [LaTeX_Vorlage_Uebungsblatt.tex](https://gist.github.com/Xennis/9637696)
\exercise
@Xennis
Xennis / hierarchy.php
Last active August 29, 2015 14:27 — forked from devi/hierarchy.php
MySQL "Closure Table" for Kohana based on Bill Karwin design.
<?php defined('SYSPATH') or die('No direct script access.');
/**
* MySQL "Closure Table" for Kohana based on Bill Karwin design.
*
* @link http://www.slideshare.net/billkarwin/models-for-hierarchical-data
* @TODO improve
*
* sql schema:
* CREATE TABLE `closures` (
* `id` int(11) NOT NULL AUTO_INCREMENT,
@Xennis
Xennis / split.py
Created January 7, 2016 17:15
Split a texfiles
import sys
def split_file(filename, num_max_lines=None):
num_lines = 0
with open(filename) as f:
for line in f:
num_lines += 1
sys.stdout.write(line)
if num_max_lines and num_lines >= num_max_lines:
break
@Xennis
Xennis / .gitignore
Created August 23, 2017 18:45
xennis-radio
/media/
############
## Python
############
*.pyc
############
@Xennis
Xennis / verify-paddle-webhook-signature.ts
Last active November 15, 2023 15:04
Verify Paddle webhook signature as described in https://developer.paddle.com/webhooks/signature-verification (in TypeScript)
import { createHmac } from "crypto"
// Verify according to https://developer.paddle.com/webhooks/signature-verification
const verifyPaddleSignature = async (payload: string, header: string | null, secret: string) => {
if (!header) {
return false
}
const [tsPart, h1Part] = header.split(";")
if (!tsPart || !h1Part) {
return false