Next.js x Prisma x Neon で DB 接続してみた
個人開発で作っていたサイトでDBを使いたかったのでNeonを使ってみました。 PlanetScaleが無料じゃなくなったらしいので、無料枠があるというNeonを使ってみようと思いました。
環境
Neonのサインアップ
公式ページからGithubアカウントで簡単にSign upできた!
ブランチの作成、セットアップ
ボタン一つで開発用ブランチの作成ができた。

Prismaからマイグレーション
あとはスキーマファイルを用意して、ローカルから簡単にマイグレーションできました。
# スキーマ例
model User {
id Int @id @default(autoincrement())
email String @unique
name String
password String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
以下のコマンドでマイグレーション。
npx prisma migrate dev --name init
あとはダッシュボードから簡単に中身を確認したりできます。

所感
無料枠もあるし、設定めちゃ簡単なので個人開発などでサクッと試したい場合にはすごくいいなと思いました!
色の補完 - d3-interpolate
D3.js
- データビジュアリゼーションライブラリ
- チャートや図などを簡単にかけるライブラリ
d3-interpolate
- 2つの値の間を補完するライブラリ
- 数値の補完から色の補完までおこなう
- ソースを見る感じ、色差は厳密に考慮されていない?
- 改善の余地ありか
d3-scale
- こちらも同様に補完してくれる
- 色差計算の必要あり?
Gitの謎エラー - Xcodeのせいかも編
発生したエラー
- いつもどおり作業しようとgitコマンドを打ち込むと下記のエラー。
xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist
原因?
対策
- 下記サイトの方のを参考にさせていただくことに
- とりあえず
brew doctor
結果(現れたWarningたち抜粋)
Warning: You have the following deprecated, official taps tapped:
Homebrew/homebrew-binary
Untap them with `brew untap`.
Warning: "config" scripts exist outside your system or Homebrew directories.
`./configure` scripts often look for *-config scripts to determine if
software packages are installed, and which additional flags to use when
compiling and linking.
Warning: No developer tools installed.
Install the Command Line Tools:
xcode-select --install
Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
ghostscript
heroku
python
xcrun: error: active developer path ("/Applications/Xcode.app/Contents/Developer") does not exist
Use `sudo xcode-select --switch path/to/Xcode.app` to specify the Xcode that you wish to use for command line developer tools, or use `xcode-select --install` to install the standalone command line developer tools.
See `man xcode-select` for more details.
Warning: Homebrew's sbin was not found in your PATH but you have installed
formulae that put executables in /usr/local/sbin.
Consider setting the PATH for example like so:
echo 'export PATH="/usr/local/sbin:$PATH"' >> ~/.bash_profile
Warning: Broken symlinks were found. Remove them with `brew cleanup`:
なるほどわからん
とりあえず言われたとおりにコマンドを打ちこんでみる
xcode-select --install
するとコマンドラインデベロッパーツールなるやつをインスコしろとの指示が...
(とりあえずここまで)
参考にしたサイト様
色差について
色差・色空間について調べたので自分なりにまとめてみた.
全然わからん...
色差
- 二色間の違いを定義したもの.
- 色差が大きいほど区別しやすい.小さいほど区別しにくい.
- ユークリッド距離で定義される.
- 従来はRGBからなる線形3次元空間で構成される色空間で計算される.
- 様々な近似や色相の形状を考えたりされたが,単純なユークリッド距離に近い傾向を表すヒトの視覚特性を考慮していない.
LAB Delta E
- 色差を
と定義
- 様々な研究によって,色同士がギリギリ弁別できる距離である
の値がたくさん提案されている.
- 値も1.0→2.3に移ろっている
- しかしもととなっているCIE LAB色空間の近く的非均一性が問題で,CIE 1994, CIE 2000の計算式が定義された.