Skip to content

Instantly share code, notes, and snippets.

View tommykw's full-sized avatar
🌞

Kenji Tomita tommykw

🌞
View GitHub Profile
$ cat xxx.csv | awk 'BEGIN {FS=",";OFS=","} {print $1}'
$ npx npm-check-updates
{
height: calc((100vw - 8px) / 4 * 3); // 4:3
width: 100%;
}
$ adb shell dumpsys activity | grep "#[0-9]* ActivityRecord" | head -n 1
@tommykw
tommykw / Start up schema by adb
Created May 10, 2022 23:45
Start up schema by adb
$ adb shell am start -a android.intent.action.VIEW -d "${url_schema}"
// Set up
$ npm init --yes
$ npm install typescript
$ npx tsc --init
$ mkdir src && cd src && touch index.ts
// node
$ npx tsc
$ node index.js
[1, 2, null, 3].filter((i) => i != null).map((i) => i ?? '')
@tommykw
tommykw / gist:c296e7f5138192cdc1ad79c468663d88
Created September 18, 2020 11:12
Vertical number list -> 1,2,3,4,5
$ cat a
1
2
3
4
5
$ cat a | awk '{print $1 "," }'
1,
2,
@tommykw
tommykw / gist:89dfa36b64f240e00343b277125f4faf
Last active May 4, 2022 04:54
Vertical number list -> 1,2,3,4,5
fun main() {
var l = readLine()
var output = ""
while (l != "") {
output += "${l},"
l = readLine()
}
println(output.removeSuffix(","))
ls | sed -e s/\.png// | awk '{print $1 ".png " "day" $1 ".png"}' | xargs -n 2 mv