2020-01-01から1年間の記事一覧
for key in dict.keys(): print(dict[key]) キーを取得しなくても要素はキーになる for key in dict: print(dict[key]) キーを使わないなら for value in dict.values(): print(value) Ref docs.godotengine.org docs.godotengine.org
以下のようにやるとnode already has a parentというエラーがでる parent.add_child(node) 一度子ノードを除いてから別の親に追加すれば移動できる if child.get_parent() != null: child.get_parent().remove_child(child) parent.add_child(child) 参考 go…
int hp = 10; String str = String.Format("HP:{0}", hp); Format文字列に{0}, {1}, {2}, ...のように中括弧で0から始まる整数を書くことで第2引数以降のobjectで置換できる。4つ以上の要素は配列で渡すことができる。 int[] hps = {10, 15, 23, 45}; String…
const obj = {title: "This is fetch"}; const options ={ method: "POST", headers: { 'Accept': 'application/json', 'Content-Type': 'application/json' }, body: JSON.stringfy(obj) } fetch("https://example.com", options) .then((res)=> res.json()…
公式:https://docs.unity3d.com/ja/2017.4/ScriptReference/Texture2D-ctor.html 幅と高さを指定して空のテクスチャを作成する。 int width = 16; int height = 16; Texture2D texture = new Texture2D(width, height); テクスチャのフォーマット、ミニマッ…
1つ前のコミットのcomitter dateとauthor dateを現在の時刻に変更する GIT_COMMITTER_DATE=\"$(date)\" git commit --amend --no-edit --date \"$(date)\" 特定のコミットを変更する git rebase <commit-hash>^ - pickをeに変更して保存 amendで更新 git rebase --continu</commit-hash>…
はじめに ご飯にする?お風呂にする?それとも私?という言葉を聞いたことがあるだろうか。この仕事等から帰ってきた旦那さんを出迎えた奥様が提示する三択は一般的には新婚三択と呼ばれているようだ。*1,*2 起源は全員集合の志村けんのコントとするものもあ…
Cloudinaryとは Cloudinaryは画像や映像、メディアを簡単に配信できるストレージサービス。URLを入力するだけや多くのAPIで画像の編集などがすぐに行える。無料枠も存在する。 テキストを表示する https://cloudinary.com/documentation/image_transformatio…
git config core.fileMode false 参考 https://stackoverflow.com/questions/1580596/how-do-i-make-git-ignore-file-mode-chmod-changes
<picture> <source type=\"image/webp\" srcset=\"flower.webp\"> <source type=\"image/jpeg\" srcset=\"flower.jpg\"> <img src=\"flower.jpg\" alt=\"\"> </picture> 参考 https://insanelab.com/blog/web-development/webp-web-design-vs-jpeg-gif-png/#:~:text=WebP%20vs.,-JPEG&text=JPEG%20is%20a%20no%2Dbrainer,JPEG…
https://github.com/nuxt-community/modules/tree/master/packages/markdownit 公式に載ってなかった https://www.npmjs.com/search?q=keywords:markdown-it-plugin ライブラリをインストールすればnuxt.config.jsのmarkdownit.useにpluginを適用できる。 { …
DockerでHeadless Chrome(puppeteer)を使う About ブラウザ操作にはjsのライブラリpuppeteerを使う GitHub: https://github.com/puppeteer/puppeteer Docker Image 日本語フォントに対応したHeadless Chrome Dockerコンテナ FROM mhart/alpine-node:12 ENV P…
Windowsのアプリの左上にあるようなメニューを作るためのノード PopupMenuをラップしているのだが、エディタからではアイテムを設定できない。 get_popup()からPopupMenuを取得して設定する必要がある。 例 var pop_up = event_menu_button.get_popup() pop_…