Skip to content

Instantly share code, notes, and snippets.

@kubukoz
kubukoz / cursed.scala
Created November 9, 2022 00:17
git conflicts parsing as Scala
object main extends App {
object <<<<<<< {
def HEAD(s: String) = this
}
implicit class StringOps(s: String) {
def =======(i: Int) = s
def >>>>>>>(i: Int) = i
}
@petrkutalek
petrkutalek / eurionize.sh
Created July 5, 2020 21:43
Adding an EURion constellation to A4 PDF
#!/bin/bash
if [[ "$#" -ne 1 ]]; then
echo "Usage: $0 filename" >&2
exit 1
fi
if [[ ! -e "$1" ]]; then
echo "$1 not found" >&2
exit 1
fi
/Td6WFoAAATm1rRGAgAhARYAAAB0L+Wj4O//F9NdADoZSs4dkJsneBz/bNOb8/VIi6mfPJyl4E3R
ZPRcjYWVP8ZadAyWoshi62XKsliYPJ3ZGvuyQYNLzaIm/jpS0gzPRcE5gLB+4tZ4uGlPDpE7k9GZ
pq4A8utK90UGiwuv9fBUm9V7i3VqqeviR3k0gMBMFA9ZaFuE8fgVPumm0RVLqzGsMjjVQKeixvOm
PtLetv0A15UkErykYvsVFqJJr0kqcHNgis9Kbs50SRQKwd02jtw6IUeczWWLH8LeY4xJKaI06VwR
HeQSj01Uq7MfDCXB5TG1fcbmQ8wH0mt0TMpj7hSyB/ftQ3ffs0qJsBlD3H8UD2REt5hz+xDlOmKU
dBbrNzWLgibljkgu6kWIXUDVXfXkLQSIFdY0WkA76QfC//SpIwRV44tdxaLR2FcDIuR9hhN4qn+u
J/of6GZC8VtsSvqAe3QbqMrmDQn7c0kD4xQrm6VAg0KaWsOxE57s0TemWRsm+egHoZdkEIu8BkQV
+ceH8rKKJhHSO0oO3Z7psBdd8lJOPpMulPkC/iwq6xEM96YIPBAmYpJ2nI+ppIyxUX2GCuuEUklH
8wBFkbQkMpK42VGEemXFOIBVC7CXr6HFf+4JdVEqxETB4DCExvMTi4W0ULDIvvLh0gHq6DOPweOs
fB4TpzMlthqCBZ/OXyJviy37nUUgIGSZ+KQNN78e2pMFRDfKY1xk+e+zl14mqklRtTBg0o9EsOPR
@gboudreau
gboudreau / AuthyToOtherAuthenticator.md
Last active April 17, 2024 21:19 — forked from Ingramz/AuthyToOtherAuthenticator.md
Export TOTP tokens from Authy
@pts
pts / tinygccpe.scr
Last active April 17, 2024 02:12
GNU ld linker script for smaller PE .exe output
/* tinygccpe.scr: GNU ld linker script for smaller PE .exe output
* by pts@fazekas.hu at Fri Feb 3 15:41:13 CET 2017
*
* It's different from the default by:
*
* * It drops initializers (e.g. .init, .ctors), and fails if the code tries
* to use them.
* * It drops exceptions (e.g. .pdata), and fails if the code tries
* to use them.
* * It merges .data and .rdata.
@jaksi
jaksi / main.go
Created December 23, 2016 17:32
Go web server
package main
import (
"bytes"
"crypto/tls"
"crypto/x509"
"fmt"
"io/ioutil"
"log"
"net/http"
@endel
endel / conver.pe
Last active January 21, 2024 06:37
FontForge script to convert .ttf file to its webfont variations (.otf, .svg, .woff, .woff2)
#!/usr/local/bin/fontforge
Open($1)
Generate($1:r + ".otf")
Generate($1:r + ".svg")
Generate($1:r + ".woff")
Generate($1:r + ".woff2")
@gumblex
gumblex / zip64.py
Created November 14, 2015 11:16
Simple Python command line utility to create Zip64 files.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Simple command line utility to create Zip64 files.
For Python 3.3+
Most code are from the standard library `zipfile` and `shutil`.
"""
@karpathy
karpathy / min-char-rnn.py
Last active April 16, 2024 18:25
Minimal character-level language model with a Vanilla Recurrent Neural Network, in Python/numpy
"""
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy)
BSD License
"""
import numpy as np
# data I/O
data = open('input.txt', 'r').read() # should be simple plain text file
chars = list(set(data))
data_size, vocab_size = len(data), len(chars)
@tuxzz
tuxzz / ruce_pcode
Created July 10, 2015 09:30
RUCE_PCode
Function main(arg)
{
/* 解析参数 */
RUCE_UnitParam para = RUCE_ParsePara(arg);
/* 从输入文件名提出音名 例如a.wav变成a */
String inputPath = para.input;
String outputPath = para.output;
String inputFileName = BaseFromFilePath(inputPath);
String inputDirName = DirFromFilePath(inputPath);