Skip to content

Instantly share code, notes, and snippets.

@acoomans
acoomans / git-contains.sh
Created March 1, 2019 20:42
Development scripts
#!/bin/bash
# search remote branches for a pattern
GREP_PATTERNS=$@
if [ -z "$GREP_PATTERNS" ] ; then
echo "Need a term to search for, like a diff number."
exit 1
fi
## ESP32
# https://docs.espressif.com/projects/esp-idf/en/latest/get-started/
git clone --recursive https://github.com/espressif/esp-idf.git
pip install -r esp-idf/requirements.txt
export IDF_PATH="$HOME/src/esp-idf"
# start project
PROMPT="%W %* %n@%m:%~%# "
autoload -Uz compinit
compinit
@acoomans
acoomans / llvm.md
Last active December 3, 2019 16:11
LLVM / Clang Development Notes & Cheatsheet
#!/usr/bin/env bash
# https://secure.phabricator.com/book/phabricator/article/arcanist_quick_start/
mkdir arcanist
cd arcanist
git clone --depth 1 https://github.com/phacility/libphutil.git
git clone --depth 1 https://github.com/phacility/arcanist.git
#!/usr/bin/env bash
if ! [ -x "$(command -v cmake)" ]; then
brew install cmake || \
echo 'cmake not found'
fi
if ! [ -x "$(command -v ninja)" ]; then
brew install ninja || \
echo 'ninja not found'
#!/usr/bin/env bash
# https://webkit.org/getting-the-code/
git clone --depth 1 git://git.webkit.org/WebKit.git
cd WebKit
Tools/Scripts/webkit-patch setup-git-clone
# https://webkit.org/building-webkit/
#!/usr/bin/env bash
GIT_CLONE_ARGS="--depth 1"
## LLVM
# http://llvm.org/docs/GettingStarted.html#git-mirror
git clone $GIT_CLONE_ARGS https://git.llvm.org/git/llvm.git
git -C llvm remote add acoomans git@github.com:acoomans/llvm.git
git -C llvm config branch.master.rebase true
int freeRam () {
extern int __heap_start, *__brkval;
int v;
return (int) &v - (__brkval == 0 ? (int) &__heap_start : (int) __brkval);
}
#!/bin/bash
UUID_REGEX='s/^.*\([0-9A-Z]\{8\}-[0-9A-Z]\{4\}-[0-9A-Z]\{4\}-[0-9A-Z]\{4\}-[0-9A-Z]\{12\}\).*$/\1/p'
xcrun simctl shutdown all
xcrun simctl delete unavailable
xcrun simctl list devices | sed -n $UUID_REGEX | xargs -I {} xcrun simctl erase "{}"
xcrun simctl list devices | sed -n $UUID_REGEX | xargs -I {} xcrun simctl delete "{}"
rm -fr "$HOME"/Library/Developer/CoreSimulator/Devices/*