Skip to content

Instantly share code, notes, and snippets.

View eliasku's full-sized avatar
💡

Elias Ku eliasku

💡
View GitHub Profile
@eliasku
eliasku / .gitignore
Last active August 9, 2023 09:32
vite + typescript
node_modules/
dist/
@eliasku
eliasku / analyze.sh
Created December 1, 2021 13:07
build size, bloaty, nm
# Install Bloaty
brew install bloaty
# Build -Os -g
dsymutil APP
strip APP
bloaty -d symbols --demangle=full -s file -n 0 --debug-file=APP.dSYM/Contents/Resources/DWARF/APP APP
@eliasku
eliasku / fix-git-commits-author.sh
Last active November 8, 2021 20:46
git: rewrite commits author and email
git filter-branch --env-filter '
OLD_EMAIL="wrong@mail.com"
NEW_NAME="author"
NEW_EMAIL="author@mail.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
export GIT_COMMITTER_NAME="$NEW_NAME"
export GIT_COMMITTER_EMAIL="$NEW_EMAIL"
fi
if [ "$GIT_AUTHOR_EMAIL" = "$OLD_EMAIL" ]
@eliasku
eliasku / cairo_round_rectangle.cpp
Created October 23, 2020 12:39
cairo: draw round rectangle with corner negative radius support
void cairo_round_rectangle(cairo_t* cr, const double* values) {
const double l = values[0];
const double t = values[1];
const double r = values[2];
const double b = values[3];
const double maxRadius = fmin((b - t) / 2, (r - l) / 2);
const double r0 = math::clamp(values[4], -maxRadius, maxRadius);
const double r1 = math::clamp(values[5], -maxRadius, maxRadius);