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/env python3 | |
""" | |
Generates random memorable passphrases. | |
This script builds a set of unique suitable words from a dictionary file, then | |
produces one or more passphrases chosen at random form that set. It also | |
optionally prints estimates of the entropy (i.e. difficulty to guess) of the | |
produced passphrases based on the number of items in the set and the number of | |
words per phrase. |
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 | |
set -eux | |
NDISPLAY=:13 | |
if [ $# -ge 1 ] | |
then | |
case $1 in | |
:*) | |
NDISPLAY=$1 | |
shift |
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 | |
set -eu | |
tmpfile=$(mktemp) | |
xauth -q -f $tmpfile generate $DISPLAY . untrusted | |
xauth_data=$(xauth -f $tmpfile nlist $DISPLAY) | |
rm -f $tmpfile | |
DOAS_XAUTH="xauth -q remove $DISPLAY ; echo $xauth_data | xauth nmerge - ;" | |
export DOAS_XAUTH |
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
#include <stdio.h> | |
int main() { | |
while (1) puts("whee"); | |
} |
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 | |
# usage: flag <flag> [args...] | |
# e.g.: flag --foo= x y z | |
# --foo=x --foo=y --foo=z | |
trap "awk '/^# /' $(which $0) | cut -d' ' -f2-" EXIT | |
set -eu; flag=$1; shift; for arg in "$@"; do echo $flag$arg; done | |
exec true |
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 | |
exec git $@ |
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
e '\\' = "\\\\" | |
e '\n' = "\\n" | |
e '\"' = "\\\"" | |
e x = [x] | |
q = concatMap e | |
m s = s ++ "\"" ++ q s ++ "\"" | |
main = putStrLn $ m s | |
where s = "e '\\\\' = \"\\\\\\\\\"\ne '\\n' = \"\\\\n\"\ne '\\\"' = \"\\\\\\\"\"\ne x = [x]\nq = concatMap e\nm s = s ++ \"\\\"\" ++ q s ++ \"\\\"\"\nmain = putStrLn $ m s\n where s = " |
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
#include <cstdio> | |
#include <exception> | |
#include <utility> | |
// hypothetically... | |
class MyException : public std::exception { | |
public: | |
const char *what() const noexcept { | |
return "nope"; |
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 A {}; | |
class B { | |
public: | |
B() = default; | |
B(B const&) = delete; | |
}; | |
class C { | |
public: |
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 | |
function main { | |
for cpu in ${CPUS[@]} | |
do | |
echo ==== $cpu ==== | |
check bazel build --ios_cpu=$cpu $DEPS | |
check mkdir -p $WORK/$cpu | |
for dep in $DEPS | |
do |