2022-01-01から1年間の記事一覧
後置ifとかの条件を使う方法を多く見るが、個人的にはfindを使うほうが便利じゃないかなーと思ってる。 where User.where(id: [4,2,6]) User Load (3.1ms) SELECT `users`.* FROM `users` WHERE `users`.`id` IN (4, 2, 6) => [] find User.fid([4,2,6]) Use…
A Tour of Go は気が向いたときに2周ほどやりました。 leanpub.com
構文 X-Forwarded-For: <client>, <proxy1>, <proxy2> ディレクティブ <client> クライアントの IP アドレス <proxy1>, <proxy2> 要求が複数のプロキシを通して行われる場合、それぞれの通過するプロキシの IP アドレスが書き出されます。つまり、最も右の IP アドレスが最も後のプロキシであり、最も左の IP </proxy2></proxy1></client></proxy2></proxy1></client>…
Option Name Description Introduced Deprecated --add-drop-database Add DROP DATABASE statement before each CREATE DATABASE statement --add-drop-table Add DROP TABLE statement before each CREATE TABLE statement --add-drop-trigger Add DROP TR…
環境構築 $ python3 -m venv .venv $ source .venv/bin/activate $ python3 -m pip install django~=4.0.2 ~ WARNING: You are using pip version 21.3.1; however, version 22.0.3 is available. You should consider upgrading via the 'python3 -m pip in…
# Django Extensionsを入手するにはpipを使います。 pip install django-extensions # プロジェクトで django_extensions を有効にするには、プロジェクトの settings.py ファイルで INSTALLED_APPS に追加する必要があります。 # django_project/settings.p…
breakpoint() OR import pdb; pdb.set_trace() www.python.org
. ├── bucket-source.txt └── bucket-target.txt # ファイルの中身 # 例: 2022-02-16 13:22:50 152916 hogehoge 2010-05-02 13:22:50 292916 fugafuga 2021-07-16 14:34:00 352916 piyopiyo ↓ 実行 diff <(cut -c 20- bucket-target.txt) <(cut -c 20- buck…
for v in `echo バージョン番号1 バージョン番号2 バージョン番号3 バージョン番号4 バージョン番号5`; do bundle exec rails db:migrate:down VERSION=$v; done