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 docker run -i -t --rm "$1" /bin/bash |
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 json | |
import os | |
import requests | |
import sys | |
import urllib.parse | |
def google_search(**params): | |
params = dict(params, source='python', output='json') | |
response = requests.get('https://serpapi.com/search', params) | |
if response.status_code != 200: |
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 | |
export PM=$(grep -c processor /proc/cpuinfo) | |
# TODO compile LLVM compiler_rt for target | |
./configure \ | |
--prefix=/ \ | |
--target=armv7a-unknown-linux-eabi \ | |
CC=clang \ |
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
#!/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> |