ブラウザの履歴から自動的に Twitter 関連のエントリを削除する拡張機能が欲しい。
なかったら自分で作るけど、拡張機能のAPIで履歴っていじれるのかな。
Flutter 3.29.3 にて。
String accessToken = String.fromEnvironment("MAPBOX_ACCESS_TOKEN");
ではダメで、const が必要。
String accessToken = const String.fromEnvironment("MAPBOX_ACCESS_TOKEN");
参考: https://stackoverflow.com/a/76718173
追記: 公式ドキュメントにも書いてありました。
https://api.flutter.dev/flutter/dart-core/String/String.fromEnvironment.html
This constructor is only guaranteed to work when invoked as
const. It may work as a non-constant invocation on some platforms which have access to compiler options at run-time, but most ahead-of-time compiled platforms will not have this information.
adb.exe の場所
C:\Users\[user]\AppData\Local\Android\sdk\platform-tools\
WiFi Debug 方法: 「ペア設定コードによるデバイスのペア設定」を押して
adb pair <host:port> <paring code>
その後, (このポート番号は「IPアドレスとポート」のところに表示されてるやつ)
adb connect <host:port>
ビルドの転送のため、ネットワーク速度は開発体験的に重要そう。
Factorio server にプレイヤーが入退出した時に Discord に Webhook で通知するスクリプト。
Factorio server の標準出力を監視して、Join と Leave に関するメッセージを regex で取得している。
使い方: 以下のスクリプトを factorio_watcher.sh という名前で保存して ./path/to/factorio --start-server ... | DISCORD_WEBHOOK_URL=https:/... ./factorio_watcher.sh
#!/bin/bash
# Factorio Watcher Script
# Provide DISCORD_WEBHOOK_URL as environment variable
# Check envvar
if [ -z "$DISCORD_WEBHOOK_URL" ]; then
echo "DISCORD_WEBHOOK_URL is not set. Exiting."
exit 1
fi
while read -r line; do
echo "$line"
if [[ $line =~ \[JOIN\]\ (.*)\ joined\ the\ game$ ]]; then
player="${BASH_REMATCH[1]}"
message="${player} が Factorio サーバーに参加しました"
elif [[ $line =~ \[LEAVE\]\ (.*)\ left\ the\ game$ ]]; then
player="${BASH_REMATCH[1]}"
message="${player} が Factorio サーバーから退出しました"
else
continue
fi
# Send message to Discord
curl -X POST -H "Content-Type: application/json" -d "{\"username\": \"FactorioWatch\", \"content\": \"${message}\"}" "$DISCORD_WEBHOOK_URL"
done
Gist もあります: https://gist.github.com/tinaxd/e468145ccbf268b2ad1d5343e5684727