This file contains hidden or 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
⍝ Left rotate ⍺ bit | |
Rot8 ← {2⊥⍺⌽(8⍴2)⊤⍵} | |
⍝ Addition and subtraction in finite field GF(2) | |
Add2 ← {⍺ ⊤≠ ⍵} | |
⍝ Multiplication in GF(2) [x]/(x8 + x4 + x3 + x + 1) | |
Mul2 ← {⊤≠/({⍵,$FF ⊤∧ ($11B×$80≤¯1↑⍵) ⊤≠ 2ׯ1↑⍵}⍣7 ⍺) × ⌽(8⍴2)⊤⍵} | |
⍝ Multiplicative inverse, calculated by brute force | |
Mul2Inv ← {$FF ⊤∧ 1⍳⍨⍵ Mul2¨⍳255} | |
SBox ← {⊤≠/$63,(1-⍨⍳5) Rot8¨Mul2Inv ⍵}¨1-⍨⍳256 |
This file contains hidden or 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/local/bin/lua52 | |
-- Replace all control characters with printable representations as in SciTECO. | |
-- These characters are printed in reverse using ANSI escape sequences. | |
-- This is especially useful as the diff textconv filter for Git as in | |
-- git config --global diff.teco.textconv tecat | |
local file = #arg > 0 and io.open(arg[1], 'rb') or io.stdin | |
while true do | |
local buf = file:read(1024) | |
if not buf then break end | |
io.write((buf:gsub("[\00-\08\11\12\14-\31]", function(c) |
This file contains hidden or 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
#! perl | |
=head1 NAME | |
52-osc - Implement OSC 52 ; Interact with X11 clipboard | |
=head1 SYNOPSIS | |
urxvt -pe 52-osc |
This file contains hidden or 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
-- This is a spell checker based on aspell. | |
-- It only requires the aspell CLI tool to be installed, but perhaps it won't work on | |
-- Windows. | |
-- You can just copy this into SciTEStartup.lua. | |
-- | |
-- TODO: Dictionaries should be configurable per file | |
-- TODO: Support named styles in aspell.styles.lexer? | |
-- | |
-- The following should be copied into SciTEUser.properties and adapted: | |
--[[ |
This file contains hidden or 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
#!/bin/sh | |
# Creates a commit from the given files and automatically | |
# squashes it into the last commit on HEAD. | |
set -e | |
if [ "x`git branch -r --contains HEAD`" != x ]; then | |
echo "HEAD commit already pushed?" | |
exit 1 | |
fi |
This file contains hidden or 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
#!env bash | |
# ./timebutler start|pause|resume|stop|cancel|status [project] | |
# You have to set USERID and AUTH variables in ~/.timebutler! | |
# Run `curl -X POST 'https://timebutler.de/api/v1/users' -d "auth=$AUTH"` to fetch user ids. | |
set -e | |
. ~/.timebutler | |
test -n "$AUTH" -a -n "$USERID" | |
COMMAND=$1 |
OlderNewer