Voltaの案件とnodenvの案件を行き来することになったので切り替え方法のメモ。 環境 macOS M1 volta 1.0.5 nodenv 1.4.1 両方有効な場合の挙動 ~/.zshrc 設定を見る: # Volta設定 export VOLTA_HOME="$HOME/.volta" export PATH="$VOLTA_HOME/bin:$PATH" # n…
cdk-nagを触ってみた。 Security HubやAWS Configを使った設定チェックはデプロイ後のチェックになるのに比べ、cdk-nagはデプロイ前に静的解析できるのが特長。違反しているとそもそもデプロイできないので開発メンバーに確実にルールを守ってもらえる。CIに…
届いたメール: You're invited to use the OpenAI GPT-4 API! You can now access GPT-4 models with 8K context via the existing OpenAI API. Get started As an early customer we'd love to hear about your experience. Feel free to share feedback on…
ECR+App RunnerをCDKデプロイする - dyoshikawa’s blog をさらに実戦に近づけるために、今度はNode.js Expressアプリをデプロイしてみる。 環境 M1 Mac Big Sur node 16.15.0 typescript 5.0.2 aws-cdk-lib 2.69.0 constructs 10.1.281 @aws-cdk/aws-apprunn…
[アップデート] AWS App Runner でついに AWS WAF がサポートされました | DevelopersIO 自分は圧倒的にLambdaマンだが、WAF対応もしたということで本番投入機会が増えていきそうなApp Runnerをキャッチアップしてみる。CDKで素振りする。 Dockerのhttpdイメ…
ChatGPT APIを使うことで、これまで難しかった「ふわっとした」バリデーションができることに気づいた。 「${content}」は暴力的な表現が含まれますか?3文字以内で、「はい」か「いいえ」で答えて下さい。` と聞くことで「はい」か「いいえ」が返ってくるの…
jerryjliu/gpt_index: LlamaIndex (GPT Index) is a project that provides a central interface to connect your LLM's with external data. LlamaIndex(GPT Index)を使うことで、大量の独自知識を詰め込んだオリジナルChatGPTを作る的なことができるらし…
stackでHaskell入門していたら stack build 時に下のようなエラーに遭遇しました。 Encountered error while migrating Pantry database: SQLite3 returned ErrorNotFound while attempting to perform step: database disk image is malformed Please repor…
設定をずっと見てたんですが indicator-datetime をインストールする必要があったみたいです。 盲点。 sudo apt install indicator-datetime さらにUbuntu Tweaksというのを入れるとより詳細に設定できるようです。
LocalStackのようなエミュレータを活用したテストコードでよく使うやつ。 Python 3.8.3 boto3 1.16.14 pytest 6.1.2 ここで記載するサンプルメソッドは下のようなクラスに所属している前提になります。 import boto3 import mypy_boto3_dynamodb.service_res…
僕はこうしてます。 Python 3.8.3 Poerty 1.1.4 pytest 6.1.2 black 20.8b1 flake8 3.8.4 (mccabe: 0.6.1, pycodestyle: 2.6.0, pyflakes: 2.2.0) mypy 0.790 lint: poetry run black --check ./src ./tests poetry run flake8 ./src ./tests --exclude __in…
Pythonのモジュール解決周りは難解ですね・・・ Python 3.8.3 Poerty 1.1.4 pytest 6.1.2 $ poetry run pytest ./src ./tests ImportError while importing test module 'project_dir/tests/foo/test_bar.py'. Hint: make sure your test modules/packages h…
Python 3.8.3 Poerty 1.1.4 mypy 0.790 $ poetry run mypy ./src src/foo/__init__.py:1: error: Cannot find implementation or library stub for module named 'src/foo/bar' src/foo/__init__.py:1: note: See https://mypy.readthedocs.io/en/latest/run…
atcoder.jp youtu.be 解説動画を見ながら自分なりに噛み砕いたメモ。 A * B + C = N 式変形するとこうなる。 C = N - A * B つまり、CはAとBが決まれば自動的に決まる。 なのでAとBの組み合わせだけを考えれば良いという状態に持っていきたい。 A * Bの範囲…
この記事は #祭り化 Advent Calendar 11日目の記事です。 マツリカ株式会社にバックエンド (寄り) エンジニアとして入社して半年近く経った。 「祭り化」に対する自分の見解や、地方フルリモートで働くことについて、また初めて自社プロダクト開発に携って感…
ja.wikipedia.org func Soe(n int) []int { nums := []int{} for i := 2; i <= n; i++ { nums = append(nums, i) } pnums := []int{} sqrtVal := int(math.Sqrt(float64(n))) for true { if sqrtVal <= nums[0] { for _, v := range nums { pnums = append(p…
C: 幅優先探索 - AtCoder Beginner Contest 007 | AtCoder F#と幅優先探索を同時に学ぼうとした。 namespace App open System.Collections.Generic module Main = let createGraph (maze : string [] []) : Dictionary<int * int, (int * int) list> = let graph = new Dictionary<int * int, (int * int) list>() let m</int></int>…
open System [<EntryPoint>] let main argv = let a = "str" printfn a 0 コンパイルエラー The type 'string' is not compatible with the type 'Printf.TextWriterFormat<'a>' が発生。 どういうこと……? F# printf string - Stack Overflow なるほど。 open System [<EntryPoint>]</entrypoint></entrypoint>…
stackoverflow.com version: '3' services: dynamodb: image: amazon/dynamodb-local command: -jar DynamoDBLocal.jar -sharedDb -dbPath /home/dynamodblocal/data/ volumes: - ./volumes/dynamodb:/home/dynamodblocal/data /home/dynamodblocal/data を…
dayjsにはmomentにおけるmoment-timezoneに相当するAPIがない。 github.com const dayjs = require('dayjs') console.log(dayjs(new Date().toLocaleString("en-US", {timeZone: "America/New_York"})).format('h:mA')) console.log(dayjs(new Date().toLoca…
Ubuntu 16.x Certbot 0.23.0 Python 2.7.12 証明書の期限が切れていて、確認するとcertbotがエラーを起こしていて自動更新できていなかった。 ImportError: No module named ordered_dict certbotというよりはPythonのエラーだろうという軸で調べると下を発…
version: '3' services: db: image: amazon/dynamodb-local ports: - 8000:8000 db-admin: image: aaronshaf/dynamodb-admin ports: - 8001:8001 environment: AWS_REGION: us-east-1 AWS_ACCESS_KEY_ID: local AWS_SECRET_ACCESS_KEY: local DYNAMO_ENDPOIN…
TypeScriptファイルをParcelでビルドしServerlessFrameworkでデプロイするというのをやろうとしたら下記エラーが発生。 An error occurred: RideDashrecordDashstoreLambdaFunction - Unzipped size must be smaller than 262144000 bytes (Service: AWSLamb…
TypeScript 3.5.1 Promise.all() の理解が曖昧だった。 const asyncFunc = async (prefix: string): Promise<void> => { return new Promise(resolve => { setTimeout(() => { console.log(`${prefix}_1秒待ちました`) return resolve() }, 1000) }) } const main </void>…
typescript 3.5.1 jest 24.8.0 typeorm 0.2.18 import faker from 'faker' import { deleteSchedule } from '~/domain/deleteSchedule' import { ScheduleRepository } from '~/repository/ScheduleRepository' import { scheduleFactory } from '~/test/fac…
TypeORMで 今日の予定を取得する っていうWhereクエリを書きたくて、あんまりRDBの関数は使いたくなくてMoment.jsから日時取得してセットするようにしたんだけど今日の始まりと終わりをどう取得するかわからなかったので調べた。 qiita.com startOf endOf を…
環境 Xcode 10.2.1 Swift 4.x 症状 ユニットテストを実行しようと ⌘+U を押すが無反応。 Product->Testから実行しようとしてもTestがdisabledになっている。 解決策 stackoverflow.com Product->Scheme->Edit Scheme->Testを選択。 Tests の欄に何もないのが…
yaruzou.net CSSについては上記を丸々参考にしている。 これをstyled-componentsを使ってReactコンポーネント化する。 import styled from 'styled-components' const Loading = styled.div` opacity: 0.7; width: 100%; height: 100%; ` const LoadingSpinn…
dyoshikawa.hatenablog.com 前回、phpenvで phpenv install 5.6.40 と目当てのバージョンのPHPを入れたものの、それをApacheサーバで使ってもらうためにはどうすれば良いのかがわからない。 qiita.com phpenvとapacheを連携させる | カバの樹 インストール時…
CentOS6系、レガシーWordPress環境でPHPのバージョンを5.6.12→5.6.40に上げる作業をしたのでメモ。 今回はanyenv/phpenvを使った。 github.com Readmeの通りにanyenv導入し、 anyenv install phpenv でphpenv導入。 phpenvで phpenv install 5.6.40 と5.6.40…