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 | |
low_battery_percent=20 | |
low_remaining_minute=5 # max is 60 | |
low_battery_sound_file="~/bin/ultramanCTSE.mp3" | |
full_battery_sound_file="~/bin/full_battery.wav" | |
max_sound_length_in_second=10 # max is 60 | |
# Dependencies & Troubleshooting: https://superuser.com/a/308441/943615 |
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
# https://gist.github.com/junegunn/f4fca918e937e6bf5bad#gistcomment-2731105 | |
# my git log | |
mgl() | |
{ | |
local the_git_log = 'git log --graph --pretty=format:"%C(bold blue)%s%C(auto)%d%n%C(yellow)%h%Creset %an, %C(magenta)%ar%Creset at %C(cyan)%ad%n%b" --date=format:"%H:%M" --author-date-order --all' | |
ggloga --color=always | \ | |
fzf --ansi --no-sort --reverse --tiebreak=index --preview \ | |
'source ~/.alias; f() { set -- $(echo -- "$@" | grep -o "[a-f0-9]\{7\}"); [ $# -eq 0 ] || git show --color=always $1 ; }; f \ | |
"$(the_git_log | head -$(({n} + 2)) | tail -2)"' \ | |
--bind 'ctrl-j:preview-down,ctrl-k:preview-up,alt-j:preview-page-down,alt-k:preview-page-up,ctrl-m:execute: \ |
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 bash | |
# Sample usage : tts "your text here" | |
# or : tts your text here (if there are no symbol) | |
tts() { | |
input="$@" | |
# https://stackoverflow.com/a/56321886/9157799 | |
query=$(python3 -c "import urllib.parse; print(urllib.parse.quote('$input'))") |
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 bash | |
# usage: gh [file] | |
gh() { | |
repoURL=$(git config remote.origin.url | sed "s~git@\(.*\):\(.*\)~https://\1/\2~" | sed "s~\(.*\).git\$~\1~") | |
branch=$(git branch | grep \* | cut -d ' ' -f2) | |
relativePath=$(git rev-parse --show-prefix) | |
google-chrome "$repoURL/tree/$branch/$relativePath$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
import java.lang.Math; | |
public class Main | |
{ | |
public static void main(String[] args) | |
{ | |
nthRootCalculatorTest(10000, 8); | |
} | |
public static Double calculateNthRootUsingMathLog(Double base, Double n) |