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
if type brew &>/dev/null; then | |
if brew list llvm &>/dev/null; then | |
alias clang-tidy="$(ls -1 $(brew --cellar llvm) | sort -V | tail -n 1 | xargs -I {} echo $(brew --cellar llvm)/{}/bin/clang-tidy)" | |
fi | |
fi |
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
# Open the current directory's GitHub repo in web browser | |
alias open-repo="open \"\$(git config --get remote.origin.url | sed -E 's/[email protected]:/https:\/\/github.com\//; s/\.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
// Plays note with infinite sustain when pressed. | |
// Unlatches note when it is pressed again. | |
// Initialize an empty set to store latched notes | |
var latchedNotes = new Set(); | |
function HandleMIDI(event) { | |
// Check if the event is a note on or note off | |
if (event instanceof NoteOn) { | |
if (latchedNotes.has(event.pitch)) { |
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/bash | |
# Given a process ID, print time,%cpu,%mem,vsz,rss in CSV format once per minute. | |
# Check if PID is provided | |
if [ -z "$1" ]; then | |
echo "Usage: $0 <PID>" | |
exit 1 | |
fi |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 | |
"""Tests/examples for the argparse module. | |
Run "python3 argparsetest.py -h" for help. | |
""" | |
from argparse import ArgumentParser | |
def main(): |
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
# Makefile for Mermaid files in this directory | |
# | |
# `make all` - build all targets | |
# `make png` - build PNGs for all source files | |
# `make svg` - build SVGs for all source files | |
# `make pdf` - build PDFs for all source files | |
# `make clean` - delete all targets | |
# `make listsources` - print list of all files to be processed | |
# `make listtargets` - print list of all output files |
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 | |
# Walks a directory tree, creating a Markdown representation of it. | |
# | |
# First command line argumaent is root directory. Defaults to current directory. | |
import os | |
import sys | |
if len(sys.argv) > 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
# Makefile for GraphViz files in this directory | |
# | |
# `make all` - build all targets | |
# `make clean` - delete all targets | |
# `make listtargets` - print list of all targets | |
# `brew install graphviz`, or download from <http://graphviz.org/download/> | |
# to get the `dot` utility. | |
DOT?=dot |
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
-- Choose a white noise generator and play. | |
-- | |
-- Requires installation of SoX <http://sox.sourceforge.net> | |
-- With Homebrew: brew install sox | |
-- | |
-- Starts a background process. Kill it with command "killall play" or by running the "Stop Playing" script. | |
set theSynth to ¬ | |
choose from list {"pinknoise", "whitenoise", "brownnoise"} ¬ | |
with prompt ¬ |
NewerOlder