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 -e | |
set -o pipefail | |
LLVM_TAG="RELEASE_601" | |
LLVM_SRC="${HOME}/llvm/src" | |
get_llvm_project() { | |
svn export --force "https://llvm.org/svn/llvm-project/${1}/tags/${LLVM_TAG}/final" "${2}" | |
} |
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
{ | |
"editor.detectIndentation": false, | |
"editor.folding": false, | |
"editor.lineNumbers": "off", | |
"editor.renderWhitespace": "boundary", | |
"files.eol": "\n", | |
"git.autofetch": true, | |
"git.confirmSync": false, | |
"telemetry.enableCrashReporter": false, | |
"telemetry.enableTelemetry": false, |
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 | |
# | |
# TODO This doesn't work yet | |
set -e | |
set -o pipefail | |
LLVM_SRC="${HOME}/llvm-6.0.1" | |
LLVM_BUILD="${HOME}/build" | |
LLVM_INSTALL="${HOME}/sysroot" |
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 | |
for arg in "$@"; do | |
case $arg in | |
-c) | |
exec clang -emit-llvm -flto "$@" | |
esac | |
done | |
exec clang -fuse-ld=lld -flto -static -Wl,--gc-sections -Wl,--strip-all -Wl,--threads "$@" |
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
# Music scale frequency generator | |
# Luke McCarthy 2018-08-29 | |
# | |
# References: | |
# https://pages.mtu.edu/~suits/NoteFreqCalcs.html | |
# https://pages.mtu.edu/~suits/notefreqs.html | |
# https://en.wikipedia.org/wiki/A440_(pitch_standard) | |
base_pitch = 440 # A4 = 440Hz (concert pitch) | |
sample_rate = 44100 |
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 | |
CACHEDIR=/tmp/.cache-$USER | |
mkdir "$CACHEDIR" --mode=700 | |
CHROMECACHEDIR=$CACHEDIR/google-chrome | |
mkdir "$CHROMECACHEDIR" --mode=700 | |
if [ "`readlink ~/.cache/google-chrome`" != "$CHROMECACHEDIR" ]; then | |
rm -rf ~/.cache/google-chrome | |
ln -s "$CHROMECACHEDIR" ~/.cache/google-chrome |
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 <iostream> | |
struct Platform { | |
const char *name; | |
}; | |
static constexpr Platform Linux{"Linux"}; | |
static constexpr Platform Windows{"Windows"}; | |
template <const Platform *platform> |
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 | |
VERSION="edge" | |
PLATFORM="x86_64" | |
DESTDIR=/mnt/d/alpine | |
sync() { | |
REPO="$1" | |
echo "Synchronizing $1..." | |
rsync --verbose --archive --update --hard-links --delete --delete-after --delay-updates --timeout=600 \ |
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
import re | |
def regex_to_bitset(r): | |
'''Convert character class into bitset. Assumes ASCII range (0<=ch<=127).''' | |
bitset = [] | |
for i in range(0, 128, 32): | |
word = 0 | |
for j in range(i, i+32): | |
if r.match(chr(j)): | |
word |= 1 << (j - i) |
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 python | |
# | |
# Displays the average line length from a directory of source files. | |
# | |
# Luke McCarthy 2018 | |
from __future__ import print_function | |
import argparse | |
import os | |
import re |