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
// Write a sample code for goroutine with ticker | |
package main | |
import ( | |
"fmt" | |
"time" | |
) | |
func main() { |
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
package main | |
import ( | |
"encoding/json" | |
"fmt" | |
"os/exec" | |
plist "howett.net/plist" | |
) |
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
# connect adb over tcp | |
adb connect <ip>:<port> | |
# App install over adb | |
adb install package_name | |
# app install adb shell | |
adb shell pm install <app_path> | |
# app uninstall over adb |
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
func kelvinToCelsius(temp uint32, n int) float64 { | |
// wmi return temperature Kelvin * 10, so need to divide the result by 10, | |
// and then minus 273.15 to get °Celsius. | |
t := float64(temp/10) - 273.15 | |
n10 := math.Pow10(n) | |
return math.Trunc((t+0.5/n10)*n10) / n10 | |
} |