2021-08-01から1ヶ月間の記事一覧
process.env.npm_lifecycle_event で取得できます。Next.jsのexport設定を本番とステージング環境用で分ける際、 "scripts": { "dev": "next dev", "build": "next build", "start": "next start", "lint": "next lint", "export-staging": "next build && n…
jQueryのclosetとは querySelectorは己の子要素を検索するメソッドですが、closetは逆に己の親を検索する、jQueryオブジェクトのメソッドです。api.jquery.com Given a jQuery object that represents a set of DOM elements, the .closest() method searche…
microCMSのリッチエディタですが、下記サービスの埋め込みに対応しています。 YouTube(https://www.youtube.com/) Vimeo (https://vimeo.com/) Twitter (http://www.twitter.com/) Instagram (https://instagram.com) Facebook (https://www.facebook.com/…
git remote prune originで、リモートで削除されたリポジトリをローカルに反映したらpullできるようになりました。
ベクトルを合算し、原点からの角度を出すのがセオリーのようです。関数にするとこんな感じです。 function getAverageAngle(angles = []) { let x = 0; let y = 0; angles.forEach((angle) => { x += Math.sin(angle / 180 * Math.PI); y += Math.cos(angle …
MacとmycobotをUSB-Cで繋いで、python3経由で操作するための設定方法をまとめておきます。 ファームウェアの書き込みだけうまくいかず、Windows機を使いました。 myCobotとは Elephant Robotics社とM5Stack社が共同で製作した6軸の可動域を持つ協働ロボット…
Next 11を使ってウェブサイトを構築し、 yarn buildで書き出そうと思ったのですが、 Error: External synchronous scripts are forbidden. See: https://nextjs.org/docs/messages/no-sync-scripts. @next/next/no-sync-scripts とエラーが出ました。指示さ…
実装のたびに調べている気がするので、まとめておきます。iOS12.2からブラウザから加速度センサの値にアクセスするには、ユーザーからパーミッションを取ることが必須になりました。iOS12.2では設定アプリからパーミッションを取る形式だったのですが、iOS13…