- What is this?
-
A transcript of an editing session using ex.
- ex?
-
If you’ve used Vim or vi, any time you type a command starting with “:”, you’re writing an ex command. ex is the command-line only editor, and vi was originally written to provide better editing on non-dumb terminals.
- Why use ex?
-
This is an exercise in what editing used to be like before the advent of vi.
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 -e | |
# This shell script demonstrates how to use the local keyword to create | |
# dynamically-scoped variables in various shells. Notably, this technique works | |
# with AT&T ksh, as well as bash, dash, mksh, pdksh, zsh, busybox sh, and other | |
# Debian Policy-compliant sh implementations. | |
# Simple Perl-compatible testing framework. Produces TAP output. | |
COUNT=0 | |
is () { |
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 | |
# Pipe an email to standard input and, if it supports RFC 8058 one-click unsubscribe, you will be automatically unsubscribed. | |
formail -c -x List-Unsubscribe | perl -pe 's!<https?://([^>]+)>!$1!' | \ | |
xargs curl -X POST -H'Content-Type: application/x-www-form-urlencoded' -dList-Unsubscribe=One-Click |
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 | |
# | |
# Run this script as "ssh-key-algo [email protected]". You can also specify a | |
# different location if you'd like to run this against an GitHub Enterprise | |
# Server instance. | |
DIR=$(mktemp -d -t tmp.XXXXXXX) | |
trap 'rm -fr "$DIR"' EXIT |
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 | |
REV="${1:-HEAD}" | |
git show --no-patch --format=tformat:"%b" -1 "$REV" | \ | |
ruby -e 'puts $stdin.read.split("\n\n").map { |c| c.gsub("\n", " ") }.join("\n\n")' |
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/perl | |
use strict; | |
use warnings; | |
use Crypt::Passwd::XS; | |
use MIME::Base64; | |
my $password = <STDIN>; | |
chomp $password; |
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
alert(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/sh -e | |
# This shell script demonstrates how to use the local keyword to create | |
# dynamically-scoped variables in various shells. Notably, this technique works | |
# with AT&T ksh, as well as bash, dash, mksh, pdksh, zsh, busybox sh, and other | |
# Debian Policy-compliant sh implementations. | |
# Simple Perl-compatible testing framework. Produces TAP output. | |
COUNT=0 | |
is () { |
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
class MMSorter | |
def initialize(preference) | |
@preference = preference | |
@reverse = preference.each_with_index.to_h | |
end | |
def pairs(candy) | |
# Find the candies which aren't part of a pair and sort them in preference | |
# order. | |
leftovers = candy.select { |_c, cnt| cnt.odd? }.map { |p| p[0] } |
I hereby claim:
- I am bk2204 on github.
- I am bk2204 (https://keybase.io/bk2204) on keybase.
- I have a public key whose fingerprint is 88AC E9B2 9196 305B A994 7552 F1BA 225C 0223 B187
To claim this, I am signing this object:
NewerOlder