Skip to content

Instantly share code, notes, and snippets.

View james-chi's full-sized avatar

James S. Chi james-chi

  • Peertec
  • Seoul, Korea
View GitHub Profile
@james-chi
james-chi / gist:836a454c860a7fc9c1cdb7ee262ca5b5
Created March 12, 2021 11:45
get the latest version tag at a git repository
I forgot the original site, which posted following info. Sorry.
# 1. get tag from git
git ls-remote --refs --tags git-url
e.g, git ls-remote --refs --tags https://github.com/ethereum/go-ethereum.git
# 2. cut version field and sort it out
cut --delimeter='/' --fields=3 | tr '-' '~' | sort --version-sort
@james-chi
james-chi / gist:542e5a418c5881671cf962dd4041997a
Created February 24, 2021 15:21
shell script - path and name
#!/bin/bash -
# _n & _p: script name and path
_n="$( basename $0)" && _p="$( cd "$( dirname $_n )" > /dev/null 2>&1 && pwd )"
echo "\$0: $0"
echo "dir: $_p"
echo "src: $_n"

Keybase proof

I hereby claim:

  • I am james-chi on github.
  • I am k2dx9k (https://keybase.io/k2dx9k) on keybase.
  • I have a public key ASCagPNHoF1Wte25b15dwo0Wh6IH3ITSRHy1T0lcveid7Ao

To claim this, I am signing this object: