これはwebpackerがコンパイル*されていないことが原因です。なので下記のコマンドで解決しました。rails webpacker:installrails webpacker:comp...
2020/11/16
2020/10/21
GitHub 二段階認証 token
毎回やりかを忘れ。。 Personal access tokens-->https://github.com/settings/tokens$ git clone https://github.com/private-organization/repository.git
Cloning into 'repository'...
Username for 'https://github.com': xxx
Password for 'https://xxx@github.com': {ここでGitHubのパスワードでなくtokenを入力...
2020/10/17
fatal error: 'libpq-fe.h' file not found
libpq-fe.h が見当たらないらしい。次のコマンドで postgresql をインストールすることで解決。libpqはpostgresqlのことだねbrew install postgre...
2020/10/16
golang sha256
package mainimport ( "fmt" "crypto/sha256")func main() { //saltで値変わるね salt:="test" hash := hmac.New(sha256.New, []byte("1")) hash.Write([]byte(salt)) fmt.Printf("%x\n", hash.Sum(nil))}mac のshasumで無理かな?goplaygroud でやりま...
2020/10/13
rbenv nodenv
// 1.初期化設定
$ echo 'eval "$(rbenv init -)"' >> ~/.bash_profile
// 2.初期化設定の反映(既存のRubyはこれで無視される)
$ source ~/.bash_profile
// 3.rbenvのインストール:
$ brew install rbenv ruby-build
// 4.インストール可能なRubyのバージョン一覧の表示
$ rbenv install -l
// 5.指定したRubyのバージョンをインストール
$ rbenv install 2.3.5
// 6.インストールしたRubyを使用可能な状態にする⇒shimsへの反映
$ rbenv rehash全く同じ手順で nodenvをインストール...
2020/09/28
mac url access 経路
traceroute xx.xx.xx.comhost xx.x...
2020/05/29
golang var is nil
package main
import (
"fmt"
)
func main() {
var stringArr []string
//true
fmt.Println(stringArr==nil)
// zero
fmt.Println(len(stringArr))
}
make([]string,0) is not nil, len is ze...
2020/04/08
Vue.js Upload file using axios
<input type="file" @change="onFileChanged">
<button @click="onUpload">Upload!</button>
We now need the two handler methods in our Vue component:
methods: {
onFileChanged (event) {
const file = event.target.files[0]
},
onUpload() {
// upload file
}
Send as binary data
onUpload() {
axios.post('my-domain.com/file-upload', this.selectedFile)
}
Send as FormData
onUpload() {
const formData = new FormData()
formData.append('myFile', this.selectedFile, this.selectedFile.name)
axios.post('my-domain.com/file-upload',...
2020/04/07
mac node version nodebrew
Usage:
nodebrew help Show this message
nodebrew install <version> Download and install <version> (from binary)
nodebrew compile <version> Download and install <version> (from source)
nodebrew install-binary <version> Alias of `install` (For backword compatibility)
...
2020/01/18
rails string
"test".length
=>4
"t est".strip
=>test
"test".slice(1..2)
=>e...
2020/01/11
2020/01/05
local dns ngrok
./ngrok http 3...