Skip to content

Instantly share code, notes, and snippets.

View bnjmnt4n's full-sized avatar
😴
💤⚰️

Benjamin Tan bnjmnt4n

😴
💤⚰️
View GitHub Profile
@bnjmnt4n
bnjmnt4n / jj.fish
Last active May 22, 2024 11:45
Fish completions for Jujutsu
# Additional Fish completions for Jujutsu
# https://gist.github.com/bnjmnt4n/9f47082b8b6e6ed2b2a805a1516090c8
# TODO: passthru other args? E.g.. --at-operation, --repository
function __jj
command jj --ignore-working-copy --color=never --quiet $argv 2> /dev/null
end
# Aliases
# Based on https://github.com/fish-shell/fish-shell/blob/cd71359c42f633d9d71a63591ae16d150407a2b2/share/completions/git.fish#L625.
@bnjmnt4n
bnjmnt4n / keybase.md
Last active January 4, 2021 14:54
My Keybase verification proof.

Keybase proof

I hereby claim:

  • I am bnjmnt4n on github.
  • I am bnjmnt4n (https://keybase.io/bnjmnt4n) on keybase.
  • I have a public key ASDjdRv5Z2oSFkPX4p2gKo0qjUxXWNLfcM9aAsQYrFV_5Ao

To claim this, I am signing this object:

@bnjmnt4n
bnjmnt4n / changelog.sh
Created November 14, 2016 01:30
Simple script to generate a Markdown-friendly changelog.
#!/usr/bin/env sh
# Obtain the latest tag, include lightweight tags.
CURRENT=$(git describe --long --tags)
if [[ ${CURRENT} =~ (.*)-([0-9]+)-g[0-9a-z]{7}$ ]]; then
# If the current tag is the `HEAD`…
if [ ${BASH_REMATCH[2]} -eq "0" ]; then
# …compare the current tag and the previous tag.
@bnjmnt4n
bnjmnt4n / optimizing_android_apps.md
Created November 10, 2016 06:07
Simple ways to improve performance of Android apps.

Simplify Layouts

  • Avoid using nested <LinearLayout>s: Using <RelativeLayout> is usually more efficient and succinct

  • Avoid using multiple <TextView>s to style text differently: Use 1 <TextView> with SpannableStrings or HTML

    // Use HTML to style text
    textView.setText(HTML.fromHTML(string));