Skip to content

Instantly share code, notes, and snippets.

View flanfly's full-sized avatar
🔮
Cybercybercyber

Kai Michaelis flanfly

🔮
Cybercybercyber
View GitHub Profile
call plug#begin('~/.local/share/nvim/plugged')
" --- Coc ---
"Plug 'neoclide/coc.nvim', {'branch': 'release'}
" --- LSP, Autocomplete & Snippets ---
Plug 'neovim/nvim-lspconfig'
Plug 'hrsh7th/nvim-compe'
Plug 'L3MON4D3/LuaSnip'
create or replace function ksuid() returns text as $$
declare
num numeric(66) := 4324324114143141414213;
ret text := '';
alphabet constant text := '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz';
digit integer;
begin
while num > 0 loop
digit := num % 62;
num := num / 62;
@flanfly
flanfly / tmux.conf
Last active September 7, 2021 13:53
# git clone https://github.com/tmux-plugins/tpm ~/.tmux/plugins/tpm
# Press prefix + I (capital i, as in Install) to fetch the plugin.
set -g prefix C-a
unbind-key C-b
bind-key C-a send-prefix
set-option -g default-shell /bin/bash
set-option -g status-position top
set-environment -g TERM screen-256color
@flanfly
flanfly / init.vim
Last active September 7, 2021 14:24
" sh -c 'curl -fLo "${XDG_DATA_HOME:-$HOME/.local/share}"/nvim/site/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim'
call plug#begin('~/.local/share/nvim/plugged')
" --- Coc ---
Plug 'neoclide/coc.nvim', {'tag': '*', 'do': { -> coc#util#install()}}
" --- FZF and ripgrep ---
Plug 'jremmen/vim-ripgrep'
Plug 'junegunn/fzf', { 'dir': '~/.fzf', 'do': './install --all' }
@flanfly
flanfly / ron.md
Last active September 5, 2018 16:40

Defninitions

  • An UUID is a 128 bit value
  • A Spec is a 4-tuple of UUIDs. Type, event, object and location.
  • A Atom is a number, a string or a UUID.
  • An Op is a spec and a ordered sequence of zero or more atoms
  • A Frame is a non-empty, ordered sequence of ops, each with an optional terminator. Ops inside a frame are either part of a chunk or a raw op.
  • A Chunk is a non-empty, ordered sequence of terminated ops. The first op is terminated with '!' or '?', followed by zero or more ops terminated with ','. The chunks end before the first ops not terminated by ','.
  • Remove everything that's deprecated
  • Deprecated finite field pk crypto
  • Deprecate tag 18, regexp, photo IDs, S2K
  • Replace key derivations funcs w/ argon2 or scrypt
  • Introduce a PQ pk cipher suite
  • Standardize randomness generation (extract-than-expand scheme)
  • introduce SHA3
  • consider metadata protection/obfuscation
  • Make Bleichenbacher prevention explicit
  • PSS
@flanfly
flanfly / tweetsat.rs
Created March 4, 2017 00:37
TweetSAT: A DPLL-based SAT solver written in Rust that fits into 8 tweets!
/*
* This is the pretty version of TweetSAT. A DPLL-based SAT solver written in
* Rust that fits into 8 tweets:
*
* https://twitter.com/_cibo_/status/837816428250218496
*
* The dpll() function accepts a first-order formula in CNF form and returns
* true is it's satisfiable (false if not).
*
* The format of the cnf parameter follows the DIMACS format. A formula is a
@flanfly
flanfly / regs.rs
Created October 1, 2016 15:43
KC /prog/ Thread 9248
/*
Hier ist schon ein reger Faden zur Regionen da, drum bringe ich noch einen mit meinen Problem.
Angenommen ich habe auch ein zweidimensionales Array, wo zu jeder x,y Koordinate eine Zugehörigkeit zur einer Region verzeichnet ist. Die Regionen sind zusammenhängend und eindeutig einmalig da. Diese Regionen können in einander verschachtelt sein. Ich habe das im Bild so angezeigt, und dabei auch jede Region zur besseren Anschauung mit einer anderen Farbe versehen.
Meine Frage ist, wie kann ich diese Verschachtelung am Besten maschinell rausfinden und zur späteren Verarbeitung in eine Liste packen?
Also ich will zum Schluss etwas Ähnliches wie das hier haben:
{
@flanfly
flanfly / des.c
Created October 17, 2015 20:44
DES
#include <stdio.h>
#include <stdint.h>
#include <netinet/in.h>
#define htonll(x) (((uint64_t)(htonl((int)((x << 32) >> 32))) << 32) | (uint32_t)htonl(((int)(x >> 32))))
static const unsigned int IP[] = {
58, 50, 42, 34, 26, 18, 10, 2,
60, 52, 44, 36, 28, 20, 12, 4,
62, 54, 46, 38, 30, 22, 14, 6,

Keybase proof

I hereby claim:

  • I am flanfly on github.
  • I am seu (https://keybase.io/seu) on keybase.
  • I have a public key whose fingerprint is 4D4D 1C76 F909 41BE 63AD D192 4871 5F75 21C9 0717

To claim this, I am signing this object: