Archive Tags About Subscribe

sacre

author biography

  • Dec 24
    perlでサブルーチンにモンキーパッチをあてる

    ライブラリ内部の挙動を一時的に変更したい時、以下のように書いてメソッドを上書きすることができる。 sub f { # 警告の抑制 no warnings 'redefine'; # Foo::Bar クラスの roo メソッ

  • Dec 24
    Chromeの検索バーで特定のサイト配下を検索する

    Chromeの検索バーにはサイトを登録することができる。 検索窓に duckduckgo.com と入れてtabを押してから文言をいれて検索すると、Googleではなくdu

  • Dec 22
    perlでmysqlに接続してデータを入れる

    SQL::Maker::Plugin::InsertMulti を使ってテストデータをmysqlに入れたい場合に困ったのでメモ。 macOSで普通にやると DBD::mysql が入らないのだが、これは環境変数から設定してなん

  • Dec 20
    tailwindcss で横スクロール UI

    よくある横スクロールの UI を tailwind で実装する。 こんな感じで実現する。 <ul className="flex overflow-x-auto"> {list.map((g) => ( <li className="flex-none w-2/5" key={g.id}> <Card imgSrc={g.imageUrl()} imgAlt={g.name}> <p>{g.name}</p> </Card> </li> ))} </ul> 参考 css - Overflow-x not working - Stack Overflow

  • Dec 20
    [terraform] Error: Invalid legacy provider address

    ひさしぶりに terraform をアップグレードしたら以下のようなエラーが出るようになった。 Error: Invalid legacy provider address This configuration or its associated state refers to the unqualified provider “aws”. You must complete the Terraform 0.13 upgrade process before upgrading to later versions. これは

  • Dec 19
    tailwindcssで画像のアス比を固定する

    object-contain を使えばよい。 <img class="object-contain" src="/image.jpg" /> どうなっているのか css の object-fit: contain を使っている。 置換コンテンツはアスペクト比を維持したまま、要素のコンテンツボックスに収まる

  • Dec 10
    js 1 行でページ上部までスクロールする

    こうするとできる。 document.getElementsByTagName("body")[0].scrollIntoView({ behavior: "smooth" }); 説明 モダンなブラウザでは scrollIntoView が使える。 Element.scrollIntoView() - Web API | MDN behavior: "smooth" と指定するとスルスルとアニメーションしながら上にスクロールする

  • Dec 6
    Chalice の generate pipeline を試す (コードはGitHub)

    chalice pipeline の動作検証 私用のAWSアカウントで chalice pipeline コマンドを試してみた。 デフォルトだとソースコードの管理は AWS Code Commit になるが、GitHubが使いたいので

  • Nov 29
    python(pyenv) と direnv を組み合わせる

    検索すると日本語の記事は .envrc で source ./venv/bin/activate するのが出てくるが、 ディレクトリを出ても deactivate が効かないので少し不便。 公式の説明にならって layout を使うのがよさそうだ

  • Nov 28
    Serverless Python Requirements Bug Workaround

    pythonのコードを serverless でデプロイしているときに以下のエラーが出た。 TypeError: Cannot read property ‘artifact’ of undefined serverless-python-requirements のバグのようだ。 issueになっていて、1年以上直ってい

← Newer Posts Older Posts →

© Copyright 2022 site_author

Powered by Hugo Theme By nodejh