• About Cosense
  • Help
  • Log in
Daiki48
Card
  • Display by
  • Card
  • Table
Modified
  • Sort by
  • Modified
  • Created
  • Last visited
  • Most linked
  • Most viewed
  • Title
  • Daiki Nakashima
  • 自分流GitHub絵文字使い方

    #GitHub


    https://gitmoji.dev/


    追加系


    :tada: 🎉 初回コミットや、フレームワーク変更による大幅なアップデートで使用。


    :zap: ⚡️ コンポーネントの追加時に使用。


  • TODO

    やらなきゃいけない事


    Svelteをv4からv5にしたら発生したエラー(未解決)


    やりたいこと


  • NeovimでGo言語の環境構築

    #Neovim #coc.nvim


    https://scoop.sh でGoをインストール


    scoop install main/go


    coc.nvimで coc-go をインストール


    :CocInstall coc-go


  • SvelteKit + Firebaseのアプリ構築

    SvelteKitプロジェクト作成


    bun create svelte@latest


    Firebase CLIのインストール


    グローバルにインストールする。プラットフォームごとにインストールするか、npmでグローバルインストールするか。


    今回は、npmでグローバルインストールした。


  • keyball自作のために必要な情報

    #keyball


    keyballに関する情報を雑にまとめる


    購入場所


    keyball61-Shirogane Lab


    ¥25,800


  • EmacsをManjaroに導入

    #Emacs #Manjaro


    wayland環境なので emacs-wayland をインストール


    まず読む


    2020年代のEmacs入門


  • wasm_bindgen

    #Rust


    The wasm-bindgen Guide


    docs


  • 正規表現

    解説記事


    【正規表現】入門


    正規表現の基礎まとめ


  • Rustで正規表現

    #Rust


    Regex


  • Scrapboxの使い方
  • println!マクロとformat!マクロの違い

    #Rust


    似ているようで違う println! と format! の違い


    println!


    https://doc.rust-lang.org/std/macro.println.html


    fn hello_name_println(name: &str) {


  • What is ${permission-name} ?

    #Tauri


    https://discord.com/channels/616186924390023171/1261479055019216999


    https://github.com/tauri-apps/tauri-docs/blob/v2/src/content/docs/plugin/file-system.mdx


    https://github.com/tauri-apps/tauri-docs/tree/v2/src/content/docs/plugin


  • warning: output filename collision.

    #Tauri


    https://github.com/tauri-apps/tauri/issues/10192#issuecomment-2209343184


    $ bun run tauri dev


    bun run tauri dev


    Running BeforeDevCommand (`bun run dev`)


  • v1のFileEntryをv2ではどうするか

    #Tauri


    v1の FileEntry


    https://tauri.app/v1/api/js/fs#fileentry


    v2には存在しないのでそれっぽいのは...


    https://v2.tauri.app/reference/javascript/fs/#direntry


  • @tauri-apps/api/fsの削除と@tauri-apps/plugin-fsへの移行

    #Tauri


    v1からv2へ移行する際に下記のエラーが発生


    Error: The following dependencies are imported but could not be resolved:


    @tauri-apps/api/fs (imported by /mnt/sabrent/dev/sveltekit/faira/src/lib/components/CurrentPath.svelte?id=0)


  • Permission global-shortcut:allow-register not found

    #Tauri


    https://github.com/tauri-apps/tauri/issues/10185


    error: failed to run custom build command for `faira v0.1.0 (/mnt/sabrent/dev/sveltekit/faira/src-tauri)`


    Caused by:


    process didn't exit successfully: `/mnt/sabrent/dev/sveltekit/faira/src-tauri/target/debug/build/faira-d783581594c54aa9/build-script-build` (exit status: 1)


  • tauri.conf.jsonをv1からv2へ

    #Tauri


  • tauri v2へのマイグレーション

    #Tauri


    https://v2.tauri.app/start/migrate/from-tauri-1/


    v1からv2にマイグレーションする際の全体的な方法


    https://v2.tauri.app/reference/config/


    tauri.conf.json の設定項目


  • PKGBUILDファイルの書き方

    #ArchLinux #Manjaro


    https://wiki.archlinux.jp/index.php/PKGBUILD


    https://wiki.archlinux.jp/index.php/パッケージの作成#.E3.82.A4.E3.83.B3.E3.82.B9.E3.83.88.E3.83.BC.E3.83.AB.E3.81.AE.E3.83.80.E3.82.A6.E3.83.B3.E3.83.AD.E3.83.BC.E3.83.89.E3.81.A8.E3.83.86.E3.82.B9.E3.83.88


  • Unhandled Promise Rejection: shell error: failed to open: Scoped command argument at position 0 was found, but failed regex validation ^((mailto:\w+)|(tel:\w+)|(https?://\w+)).+

    #Tauri


    https://github.com/tauri-apps/tauri/discussions/8850


    tauri.conf.json の設定次第


    "tauri": {


    "allowlist": {


  • Svelteの配列操作

    #Svelte


    このコードだと entryPaths をconsole.logで確認出来るが ul タグで表示出来なかった。


    let entryPaths: string[] = [];


    async function processEntries(entries: FileEntry[]) {


    for (const entry of entries) {


  • Vim

    Vimに関する情報


  • Rust

    Rust言語に関するあれこれ


  • Deno
  • Port 5173 is in use, trying another one...

    #Vite #SvelteKit


    5173ポートを使用しているプロセスIDを特定する


    lsof -i:5173


    出力結果はこちら


    COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME


  • bun installでBlocked 1 postinstall. Run `bun pm untrusted` for details.発生時の対応

    #Bun #SvelteKit


    $ bun pm untrusted


    bun pm untrusted v1.1.18 (5a0b9352)


    ./node_modules/svelte-preprocess @5.1.4


    » postinstall: echo \"svelte-preprocess Don't forget to install the preprocessors packages that will be used: sass, stylus, less, postcss & postcss-load-config, coffeescript, pug, etc...\"


  • fcitx5-skkでInkdropに日本語入力出来るようにする

    #SKK #Inkdrop #Manjaro


    AURからインストール


    https://aur.archlinux.org/packages/inkdrop


    snapからインストールした場合、/usr/share/applications/inkdrop.desktop が存在しないためwaylandのime設定を有効に出来ない。


    設定を変更する


  • ManjaroでMicrosoft Edgeをインストールする

    #Manjaro #MIcrosoftEdge


    https://aur.archlinux.org/packages/microsoft-edge-stable-bin


    fcitx5-skkを動かしたい場合は下記を実施


    ManjaroにインストールしたMicrosoft Edgeでfcitx5-skkを動かすためにする設定


  • ManjaroにインストールしたMicrosoft Edgeでfcitx5-skkを動かすためにする設定

    #Manjaro #MicrosoftEdge #SKK


    Arch + KDE 6 (Wayland) で日本語入力環境を少しでもまともにする


    https://fcitx-im.org/wiki/Using_Fcitx_5_on_Wayland#KDE_Plasma


    sudo nvim microsoft-edge.desktop


  • error: failed to run custom build command for `javascriptcore-rs-sys v0.4.0`

    #Tauri #Manjaro


    Manjaro環境でTauriのプロジェクトを pnpm tauri dev するとタイトルのビルドエラー発生。


    The following warnings were emitted during compilation:


    warning: javascriptcore-rs-sys@0.4.0:


    error: failed to run custom build command for `javascriptcore-rs-sys v0.4.0`


  • Tauriプロジェクト.vim/coc-settings.jsonのcoc-rust-analyzer設定

    #Tauri #coc.nvim


    https://tauri.app/v1/guides/getting-started/setup/sveltekit に従ってプロジェクトを作成すると、SvelteKitプロジェクト内で pnpm tauri init を実行するため、src-tauri ディレクトリがSvelteKit内に生成される。


    https://github.com/fannheyward/coc-rust-analyzer の rust-analyzer.linkedProjects を確認する。


  • Denoの開発をcoc.nvimでする場合のcoc-settings.json

    #Neovim #Deno #coc.nvim


    coc-deno を CocInstall する。


    :CocCommand deno.initializeWorkspace を行う。


    {


    "deno.enable": true,


  • parseArgsで引数

    #Deno


    https://jsr.io/@std/cli/doc/parse-args/~/parseArgs


  • Uncached or missing jsr package: @std/fs@^0.229.3 (deno no-cache-jsr)

    #Deno #coc.nvim


    deno cacheコマンド


    https://docs.deno.com/runtime/manual/getting_started/command_line_interface#type-checking-flags


    ファイルをキャッシュする。


    deno cache main.ts


  • deno cacheコマンド

    #Deno #JSR


    $ deno cache --help


    Cache and compile remote dependencies recursively.


    Download and compile a module with all of its static dependencies and save


    them in the local cache, without running any code:


  • JSRに公開したスクリプトをdeno installでインストールしてローカルで実行出来るように

    #Deno #JSR


    https://docs.deno.com/runtime/manual/tools/script_installer


    deno install --global jsr:@daiki48/hello-cli-from-jsr


    jsr: を付ける。


    ✅ Successfully installed hello-cli-from-jsr


  • JSRに公開するまでの手順

    #Deno #JSR


    すでにJSRでスコープを作成済み https://jsr.io/@daiki48


    プロジェクトをローカルに作る


    deno init


    Neovimの設定をする。


  • std::fs::DirEntry

    #Rust


    https://doc.rust-lang.org/std/fs/struct.DirEntry.html


    ReadDir イテレータが返すエントリ


    ファイルシステム上のディレクトリ内のエントリを表す


    各エントリをメソッドで知らべることで、フルパスやプラットフォームごとの拡張特性によるその他のメタデータを確認出来る


  • crates.ioに公開する手順

    #Rust


    cargo login


    発行済みのトークンを貼り付ける


    cargo publish


  • Vecとvec!に関する情報

    #Rust


    Vec


    ヒープ領域に格納


    動的配列(ベクトル)


    サイズが可変


  • &strとStringと&Stringの違い

    #Rust


    &str


    文字列スライスと呼ばれる


    不変でサイズ固定


    文字列リテラルや他の文字列の一部を参照する際に使われる


  • std::env::current_dir

    #Rust


    https://doc.rust-lang.org/std/env/fn.current_dir.html


    この関数は現在、Unixではgetcwd関数、WindowsではGetCurrentDirectoryW関数に相当。


    現在の作業ディレクトリを PathBuf で返す。


    use std::env;


  • Firebaseのセキュリティルール

    #Firebase


    https://qiita.com/KosukeSaigusa/items/18217958c581eac9b245


    rules_version = '2';


    service cloud.firestore {


    match /databases/{database}/documents {


  • coc.nvimとrust-analyzerでNeovimのRustコーディング環境を作る

    #Vim #Neovim #coc.nvim #Rust


    https://rust-analyzer.github.io/manual.html#coc-rust-analyzer


    https://github.com/fannheyward/coc-rust-analyzer


    coc-rust-analyzerをインストール


    CocInstall coc-rust-analyzer コマンドを実施。


  • Svelte v5の$effectでasyncでエラー発生

    #Svelte


    このエラーが発生した。


    https://github.com/sveltejs/svelte/issues/9520


    $effect(async() => {


    ...


  • There are no input files to process.

    #jsDoc


    jsdoc src


    There are no input files to process.


  • git branch

    #Git


    git branch


    git branch <new-branch>


    git checkout <new-branch>


    git checkout -b <new-branch>


  • 一括置換のあれこれ

    #Vim #Neovim


    基本


    :s が基本的な形 :%s で現在開いているファイル内で置換するという意味


    ファイル内の文字列を一括置換


    :%s/hoge/bar/g


  • 日本語が良い感じに表示出来るお気に入りfont-family

    #CSS


    font-family: 'BIZ UDPGothic', 'ヒラギノ角ゴ Pro W3', 'Hiragino Kaku Gothic Pro', 'メイリオ', Meiryo, Osaka, 'MS Pゴシック', 'MS PGothic', sans-serif;


  • try catch文とif文の違い(JavaScript)

    #JavaScript


    try catch


    エラーの可能性がある処理で使用。


    エラーをキャッチして適切に処理出来る。


    例 (予期しないエラーや例外などで使用する)


  • Relative import path "@b-fuze/deno-dom" not prefixed with / or ./ or ../ (deno import-prefix-missing)

    #Deno #Error #coc.nvim


    https://github.com/denoland/vscode_deno/issues/787#issue-1530461284


    import { DOMParser } from '@b-fuze/deno-dom'; // Relative import path "@b-fuze/deno-dom" not prefixed with / or ./ or ../ (deno import-prefix-missing)


  • SvelteKitの環境変数

    #Svelte #SvelteKit #環境変数


    それぞれの特徴


    $env/dynamic/private


    サーバーサイドでのみ使用可能。


    config.kit.env.publicPrefix ではなく config.kit.env.privatePrefix で始まる変数のみを含む。


  • ogpのimageパス

    #OGP #Svelte


  • Svelteをv4からv5にしたら発生したエラー(未解決)

    #Svelte #TODO


    Uncaught (in promise) TypeError: anchor is null


    in Header.svelte


    in +layout.svelte


    in root.svelte


  • dpp.vim最小インストール設定

    #Neovim #Vim


    local denops_src = vim.fn.stdpath("cache") .. "/dpp/repos/github.com/denops/denops.vim"


    local dpp_src = vim.fn.stdpath("cache") .. "/dpp/repos/github.com/Shougo/dpp.vim"


    if not vim.loop.fs_stat(dpp_src) then


  • Lua API一覧

    #Neovim #Lua


    随時更新


    バッファ系


    nvim_create_buf(listed, scratch)


    新しいバッファを作成します。listedはバッファがバッファリストに表示されるかどうか、scratchはバッファがスクラッチ(一時的)バッファかどうかを指定します。


  • styluaの設定

    #Neovim #Lua


    column_width = 120


    line_endings = "Unix"


    indent_type = "Tabs"


    indent_width = 2


  • 検索して一致した文字を一括削除

    #Vim #Neovim


    local colors = require("sakurajima.colors")


    local highlight = require("sakurajima.highlight")


    local M = {}


    -- highlight.setup('lualine_a_command' xxx gui=bold guifg=#a7acb4 guibg=#2e7975


  • JSRのGithub Actions設定内容

    #JSR #Deno


    https://jsr.io/docs/publishing-packages#publishing-from-github-actions


    name: Publish


    on:


    push:


  • cloudflare pagesのnodejsのバージョンを指定をする

    https://zenn.dev/hisayuki_mori/articles/cloudflare-node-version


  • CSSのbuttonタグのスタイルをリセットする

    #CSS


    https://qiita.com/nabettu/items/1593af04e48444c45c53


    button{


    background-color: transparent;


    border: none;


  • CSSによるコンテンツの折り返し表示

    #CSS


    word-break: break-all;


    強制で折り返し表示出来る。


    https://developer.mozilla.org/ja/docs/Web/CSS/CSS_text/Wrapping_breaking_text


  • nvim-ts-autotagをnvim-treesitter.configsで設定している場合のエラー

    nvim-treesitter.configsでnvim-ts-autotagの設定を書いていると下記のエラーが発生する。


    #Neovim


    Nvim Treesitter Setup is deprecated, use `require('nvim-ts-autotag').setup()` instead.


    This feature will be removed in nvim-ts-autotag version 1.0.0


  • JS画像変換ライブラリ

    sharp


    jimp


  • SvelteKitで使えそうなリッチテキストエディタのライブラリ

    #SvelteKit


    tipex


    Prosemirror


    tiptap


    quill


  • SvelteKitのファイルベースルーティングで使用するファイル

    #Sveltekit


    共通のUIとデータは+layout.svelteと+layout.tsに配置。


    個別のページコンテンツとデータは+page.svelteと+page.tsに配置。


    サーバーサイド専用のロジックは+layout.server.tsと+page.server.tsに配置。


    +layout.svelte


  • 個人的Prettier設定

    #Pritter


    {


    "useTabs": true,


    "singleQuote": true,


    "trailingComma": "none",


  • JSXの書き方で画面に表示されない場合がある

    #JSX #Hono


    {}だとreturnで返さないといけない。


    return c.render(


    <div class={mainClass}>


    <h2>ドキュメント一覧</h2>


  • coc-prettierの設定

    #Prettier


    https://prettier.io/docs/en/vim.html


  • vite Internal server error: Invalid glob import syntax: Could only use literals

    #Vite #HonoX


    原因


    Viteのglobインポートが静的な文字列リテラルしか対応していない。


    変数やテンプレートリテラルなどはエラーになる。


    ▼エラーの例


  • Rust製SSG Zola導入

    #Rust #Zola


    archlinuxのインストール方法


    というかインストール方法めっちゃ細かく書いてくれてる


    https://www.getzola.org/documentation/getting-started/installation/


  • gitのデフォルトブランチをmainに変更

    #Git


    git config --global init.defaultBranch main


  • Denoの開発環境をNeovimのbuiltin-lspからcoc.nvimへ移行する際の注意

    #Neovim #Deno


    インストール


    coc.nvim


    coc-deno


    移行のタイミングで必ずnvim-lspconfigなどのbuiltin-lsp関連は読み込まないようにする。


  • coc.nvimでmarkdownを使用する

    #Neovim


    markdown


    coc-markdownlint


  • 過去のlocalhost接続を切断する

    #Deno


    ポート番号が重複している場合にエラー発生


    AddrInUse: Address already in use (os error 98)


    at listen (ext:deno_net/01_net.js:532:35)


    at Object.serve (ext:deno_http/00_serve.ts:443:16)


76 pages
  • Daiki Nakashima
  • 自分流GitHub絵文字使い方
  • TODO
  • NeovimでGo言語の環境構築
  • SvelteKit + Firebaseのアプリ構築
  • keyball自作のために必要な情報
  • EmacsをManjaroに導入
  • wasm_bindgen
  • 正規表現
  • Rustで正規表現
  • Scrapboxの使い方
  • println!マクロとformat!マクロの違い
  • What is ${permission-name} ?
  • warning: output filename collision.
  • v1のFileEntryをv2ではどうするか
  • @tauri-apps/api/fsの削除と@tauri-apps/plugin-fsへの移行
  • Permission global-shortcut:allow-register not found
  • tauri.conf.jsonをv1からv2へ
  • tauri v2へのマイグレーション
  • PKGBUILDファイルの書き方