This file contains 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 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 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 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 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/bash | |
# git-rename-tag <old-name> <new-name> | |
# NOTE: This works on the "origin" remote and preserves | |
# annotations. | |
set -e | |
# Creates a new tag on the remote AND removes the old tag | |
git push origin refs/tags/$1:refs/tags/$2 :refs/tags/$1 | |
# Remove the old local tag | |
git tag -d $1 |
This file contains 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/bash | |
# git-move-tag <tag-name> <target> | |
tagName=$1 | |
# Support passing branch/tag names (not just full commit hashes) | |
newTarget=$(git rev-parse $2^{commit}) | |
git cat-file -p refs/tags/$tagName | | |
sed "1 s/^object .*$/object $newTarget/g" | | |
git hash-object -w --stdin -t tag | |
This file contains 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 | |
# This script performs a checkout with same arguments as `git checkout` | |
# but makes sure that submodules are initialized in exactly the way | |
# described in the branch/tag. | |
# This is useful to avoid having to cleanup the tree after checkout | |
# to prevent files interfering with Eclispe and updating submodules | |
# manually. | |
# | |
# NOTE: This does not prevent other untracked files from intefering | |
# with Eclipse. |
This file contains 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 | |
# Requirements: socat, rlwrap | |
# To connect using a FTDI serial device node | |
# (requires the `ftdi_sio` driver or a native COM/UART port), e.g.: metraLine /dev/ttyUSB0 | |
# To connect to a product with builtin ethernet via TCP, e.g.: metraLine 192.168.2.239 | |
if [ -c $1 ]; then | |
# Assume $1 to be a serial device node | |
ADDRESS=FILE:$1,nonblock,raw,echo=0,b115200,cs8 | |
else |
This file contains 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/bin/lua5.2 | |
local function parse_date(str) | |
local t = {hour = 0, min = 0} | |
t.day, t.month, t.year = str:match("^(%d+)%.(%d+)%.(%d+)$") | |
return os.time(t) | |
end | |
local pattern = arg[1] or "" | |
local time_begin = arg[2] and parse_date(arg[2]) or 0 |
This file contains 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/nthe -p | |
if .environment~theco.initialized \= .nil then return | |
/* | |
* Initialize classic Rexx function packages | |
*/ | |
call ReLoadFuncs | |
/* |
NewerOlder