カテゴリー: プログラミングメモ

  • ブラウザのTwitter履歴

    ブラウザの履歴から自動的に Twitter 関連のエントリを削除する拡張機能が欲しい。

    なかったら自分で作るけど、拡張機能のAPIで履歴っていじれるのかな。

  • Flutter –dart-define が空文字になる

    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.

  • Android Flutter メモ

    adb.exe の場所

    C:\Users\[user]\AppData\Local\Android\sdk\platform-tools\

    WiFi Debug 方法: 「ペア設定コードによるデバイスのペア設定」を押して

    adb pair <host:port> <paring code>

    その後, (このポート番号は「IPアドレスとポート」のところに表示されてるやつ)

    adb connect <host:port>

    ビルドの転送のため、ネットワーク速度は開発体験的に重要そう。

  • activitypub 実装メモ

    Rust crate activitypub_federation を使用

    問題
    Misskey 宛にメンション付きのノートを送信すると UnrecoverableError: skip: failed to resolve user になる
    原因
    ユーザー情報を返すエンドポイントの Content-Type が application/activity+jsonになっていなかった

  • SQLite で UNIXタイムスタンプを ISO 8601 に変換する

    UNIX タイムスタンプ形式でテーブルに保管されたデータを ISO 8601 形式で SELECT する方法メモ

    datetime(columnName, 'unixepoch')

    うまくいかないとき

    • UNIX タイムスタンプが秒単位になっていることを確認する
      (JS の Date.now() はミリ秒単位)

    参考

    https://www.sqlite.org/lang_datefunc.html