2020-01-01から1年間の記事一覧
classic.yarnpkg.com brew install yarn
brew install postgresql brew services start postgresql
github.com brew install nodenv ~/.zshrcに以下を追記する eval "$(nodenv init -)" 何かnodeをインストール nodenv install 14.4.0
github.com brew install rbenv rbenv init ~/.zshrcに以下を追記する eval "$(rbenv init -)" 何かしらrubyをinstallしてglobalなrubyを変更する rbenv install 2.6.3 rbenv global 2.6.3 .zshrcを読み込み直す source ~/.zshrc これをやらないとbundlerをi…
Zinit(旧Zplugin)をインストールする github.com README通りにインストールをする sh -c "$(curl -fsSL https://raw.githubusercontent.com/zdharma/zinit/master/doc/install.sh)" Powerlevel10kを設定 github.com zinit ice depth=1; zinit light romkatv/…
brew.sh 公式サイトの手順通りに作業する ターミナルで以下のコマンドを叩く /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" 最初にパスワードの入力を求めらた上に実行するか一度確認があるのでエン…
git reset --hard ORIG_HEAD
z-indexをmodalより数値大きくしたら基本的には表示されるんだけど、なぜかinput要素にだけfocusが当たらなかった b-modalのオプションでno-enforce-focus をtrueにしたら解決した bootstrap-vue.org
javascriptで配列の中に同じ値のものが何個あるのかカウントするいい方法が思いつかなかった シンプルに配列をぐるぐる回しながらオブジェクトに入れていってカウントすると以下のようになる const targetArray = [1, 1, 2, 2, 3, 4, 1, 2, 3, 2, 5, 6, 6, 4…
下記を参照にimagemagickのバージョンを下げたらインストール出来た www.tweeeety.blog
下記参照して bundle configを設定すれば無事にインストールできた qiita.com
以下のコマンドで firestore.indexes.json が作成 or 上書きされる firebase firestore:indexes > firestore.indexes.json
以下の記事に他にも色々書き方書いてあった shigekitakeguchi.github.io asyncDataでデータを取得してローカルステートに入れるのはこんな感じ asyncDataで取得したのを入れる変数を定義しとかないとtypescript的にエラーが出るので定義をする @Component({ …
brew install mysql すでにinstallしてたら以下のように表示される Error: mysql 8.0.19 is already installed To upgrade to 8.0.19_1, run `brew upgrade mysql`. 以下のコマンドでインストールされているmysqlの内容を表示 brew info mysql 以下のコマン…
qiita.com とのこと JSON.stringify()の代わりにjson-stable-stringifyを使ってみる github.com install npm install json-stable-stringify 使ってみる import stringify from 'json-stable-stringify' const a = { a: 1, b: 2} const b = { b: 2, a: 1} co…
brewでpythonをinstallし直したらいいらしいんだけど 2系のpythonをuninstallしようとしたらbrewのリポジトリがないと言われ以下のようにしてinstallした brew install python@2 これだと No available formula with the name "python@2" こうなる brew inst…
なんでかわからない・・・ build/icon.png build/icon.ico を入れてビルドスルだけだと思ったけど package.jsonに以下のように書いても駄目で なぜかインストーラーだけアイコンが設定されている { "build": { "win": { "icon": "build/icon.png" }, } } 以…
extraFilesやextraResourcesの仕組みを使って開発中とパッケージングしたのを分岐する必要がある プロジェクト直下に画像用のimgフォルダがある場合 package.jsonに以下の記述を追加 { "name": "sample", "version": "1.0.0", "description": "", // 略 "bui…
navigator.permissions.query 2020年5月時点ではsafariでは対応してないみたい 存在チェックしてgetUserMedia直接呼ぶことにする
aruo.net startsWithがあるらしい //startswith var str = 'To be, or not to be, that is the question.'; console.log(str.startsWith('To be')); // true console.log(str.startsWith('not to be')); // false console.log(str.startsWith('not to be', 1…
psqlを実行すると以下の様なメッセージが表示される The data directory was initialized by PostgreSQL version 11, which is not compatible with this version 12.2. 書いてあるとおり11で作られたデータだから12では動かないと 以下を実行してデータコン…
以下のような感じでsrcの中を取得する const text = "<img src='http://example.com/image.png'>テスト画像" const parser = new DOMParser(); const htmlDoc = parser.parseFromString(text, 'text/html'); const img = htmlDoc.querySelector('img') if (img) { console.log(img.src) } これを実行…
仮想スクロールライブラリであるvue-virtual-scrollerを使ってみる チャットとか大量のリストを表示するときに表示されているところだけdomを作ってくれる系のライブラリ github.com インストール npm install --save vue-virtual-scroller typescript用に型…
let array = [1,2,3,4,5] // 入れ替える要素のindex const index = 2; array.splice(index-1, 2, array[index], array[index-1]); console.log(array) => [1,3,2,4,5] www.infoscoop.org Arrayオブジェクトのsplice()メソッドは、配列から要素を削除・追加し…
別タブやブラウザが非アクティブになったときに発火する window.onblur = () => { console.log("onblue") }
github.com インストール npm install --save rss-parser READMEに従って以下のコードを動かしてみる let Parser = require('rss-parser'); let parser = new Parser(); (async () => { let feed = await parser.parseURL('https://remoter.hatenablog.com/r…
www.npmjs.com グローバルにインストール npm install -g npm-check-updates ncuコマンドで更新のあるライブラリを表示 インストール直後はコマンドが見つからずターミナルを開き直したら実行できた ncu 以下のコマンドでプロジェクトのpackage.jsonも更新し…
vue-web-camgithub.com インストール npm install vue-web-cam --save nuxt.config.jsを編集してmodulesに追記 //省略 modules: ['vue-web-cam/nuxt'] //省略 基本的な使い方は以下の様にtemplate内に埋め込み利用する
assets配下に再生したいファイルを配置 オーディオファイルをロードするように Webpack の設定を拡張する 以下を参考にnuxt.config.tsを修正 ja.nuxtjs.org // 省略 build: { extend(config: any, _: any) { config.module.rules.push({ test: /\.(ogg|mp3|w…
他の項目の値を参照して、validatesの有効化したい場合 例えば emailが入力されている場合のみnameの必須チェックをしたい場合は以下の様に書く validates :name, presence: true, if: Proc.new {|r| r.email.present? }