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 bash | |
set -eux | |
# Executable directories | |
PATH=bin:tools:${PATH} | |
# Executable |
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 php | |
<?php | |
list(, $file, $source) = array_pad($argv, 3, ''); | |
if ($source !== '' && $source !== 'message') { | |
exit(0); | |
} | |
$branch = `git symbolic-ref --short HEAD`; |
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 bash | |
set -eu | |
HOST=$1 | |
echo | \ | |
openssl s_client -servername $HOST -connect $HOST:443 2>/dev/null | \ | |
openssl x509 -text -noout |
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
FROM debian:stretch | |
RUN apt-get update && apt-get install -y ghc ghc-prof | |
WORKDIR /app |
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
flat_prime_factors :: Integral n => n -> [n] | |
flat_prime_factors n = | |
case factors of | |
[] -> [n] | |
_ -> factors ++ flat_prime_factors (n `div` (head factors)) | |
where | |
factors = take 1 $ filter fcb [2 .. int_sqrt n] | |
fcb x = n `mod` x == 0 | |
int_sqrt = floor . sqrt . fromIntegral |
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 bash | |
set -eu | |
git fetch -p | |
for branch in `git branch -vv | grep ': gone]' | awk '{print $1}'`; do git branch -D $branch; done |
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 sh | |
git diff --shortstat `git hash-object -t tree /dev/null` |
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
<?php | |
/** | |
* @param string ...$rest | |
*/ | |
function join_path(...$rest): string | |
{ | |
if (count($rest) === 0) { | |
return ''; | |
} |