Skip to content

Instantly share code, notes, and snippets.

View klkyy2020's full-sized avatar
🌴
On vacation

klkky2020 klkyy2020

🌴
On vacation
View GitHub Profile
@klkyy2020
klkyy2020 / sync_upstream
Created May 9, 2020 10:44
sync upstream everywhere
#!/bin/bash
# https://gist.github.com/Juraci/d1414f7c780e2dbe8204
# modified by klkyy2020(klkyy2020 at 163 dot com)
red=$(tput setaf 1)
green=$(tput setaf 2)
yellow=$(tput setaf 3)
myexit() {
reason=$1
// validRange returns false if 0 is between 1 or starts with 0
// otherwise returns true
func validRange(val byte) bool {
v := val
foo := byte(128)
firstBit := true
zeroAppears := false
if v == 0 {
return false
}