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/bin/env perl | |
# klg, Jan 2017 | |
use strict; | |
use open ':std', IO => ':bytes'; | |
use Bencode 'bdecode'; | |
my $meta = eval { bdecode(do { local $/; <> })->{info} }; | |
die "Invalid BitTorrent metainfo file: $@" if $@; | |
if ($$meta{length}) { |
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
/* cc -O3 -nostdlib -static -fno-builtin -s hello.c */ | |
#if defined __x86_64__ | |
#define SYS_exit 60 | |
#define SYS_write 1 | |
static __attribute__ ((noreturn)) | |
void exit(int status) { | |
__asm__ volatile ( |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
⍝! | |
⍝ PBM/PGM/PPM | |
⍝ klg, Aug 2016 | |
PNM∆∆WS←⎕UCS 32 9 13 10 | |
∇PNM∆∆Assert X | |
'PNM Syntax Error' ⎕ES (~X)/5 4 | |
∇ |
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
"use strict"; | |
// klg, Sep 2016 | |
function LoadWebP(url) { | |
// Fetch the WebP | |
return new Promise(function (resolve, reject) { | |
var xhr = new XMLHttpRequest(); | |
xhr.open('GET', url, true); | |
xhr.responseType = 'arraybuffer'; | |
xhr.onerror = function (e) { reject(e); }; |
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
" APL keymap for VIM | |
" klg, Jul 2016 | |
scriptencoding utf-8 | |
let b:keymap_name = "APL" | |
com -nargs=1 APLQuoteKeyboard let s:keyboard = <q-args> | |
APLQuoteKeyboard | |
\ ╔════╦════╦════╦════╦════╦════╦════╦════╦════╦════╦════╦════╦════╦══════════╗ | |
\ ║ ~ ║ !⌶ ║ @⍫ ║ #⍒ ║ $⍋ ║ %⌽ ║ ^⍉ ║ &⊖ ║ *⍟ ║ (⍱ ║ )⍲ ║ _! ║ +⌹ ║ ║ | |
\ ║ `⋄ ║ 1¨ ║ 2¯ ║ 3< ║ 4≤ ║ 5= ║ 6≥ ║ 7> ║ 8≠ ║ 9∨ ║ 0∧ ║ -× ║ =÷ ║ Backsp ║ |
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
⍝! | |
⍝ RFC 7159 JSON | |
⍝ klg, Jul 2016 | |
⍝ vim:kmp=apl: | |
∇JSON∆∆Assert X | |
'JSON Syntax Error' ⎕ES (~X)/5 4 | |
∇ | |
∇R←A JSON∆∆Expect J |
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
# Maintainer: klg <[email protected]> | |
pkgname=wget-lua | |
pkgver=1.14_git20160530 | |
_pkgver=1.14.lua.20160530-955376b | |
pkgrel=3 | |
pkgdesc="Wget with Lua extensions" | |
url="https://www.archiveteam.org/index.php?title=Wget_with_Lua_hooks" | |
arch="all" | |
license="GPL3+" | |
depends="" |
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 | |
# klg, Apr 2016 | |
set -e | |
UPSVN="$(git log -n 1 --format=%H --grep '^git-svn-id:' -- "$@")" | |
if [ -z "$UPSVN" ]; then | |
echo >&2 "No git-svn commit found" | |
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
⍝! | |
⍝ klg, Mar 2016 | |
]USERCMD ]EDIT EDIT⍙ 1 | |
∇S EDIT⍙ Q;FN;FD | |
⍝ Edit a function or operator in external editor. | |
⍎(2>≡S)/"']EDIT NAME' ⋄ →0" | |
S←(⎕IO+1)⊃S | |
⍎(2=⎕NC S)/"S,' is a variable' ⋄ →0" |