プログラマーのあああブログ

プログラミングなどなど (PHP, node, Golangとか書いてます)

Babelでコンパイルしたclassの "[class名] is not a constructor" エラーの対処

Babelでコンパイルしたモジュールをrequire()で使おうとしたら、以下のエラーメッセージがでました。 "[class名] is not a constructor" 例えばこんな風にclassを作ってBabelでコンパイルして export default class dog { ... } そしてrequire() でモジュー…

Ubuntu16.0.4 メールサーバー構築設定(バーチャルメールボックス) Postfix + Dovecot

さくらVPSでメールサーバーを構築したときの手順です。 下記バージョンで設定しました。 Ubuntu 16.04 Postfix 3.1.0 Dovecot 2.2.22 バーチャルメールボックスで info@mail.example.com 上記のメールアドレスを作成します。 バーチャルメールボックスを使え…

(メモ) Ubuntu(16.0.4) crontab のエディタ変更方法

Ubuntu(16.0.4) での crontab のエディタ変更方法のメモ 下のコマンドを実行してエディタのセレクト画面を表示 sudo select-editor 1-3の数字の中からエディタを選択する Select an editor. To change later, run 'select-editor'. 1. /bin/ed 2. /bin/nano …

Windowsでフォルダーが削除できない場合の対処

たまにWindowsのフォルダーが削除できなくなるのでコマンドプロンプトでの対処方法をメモ。 特にフォルダーの名前が複雑だったり長い場合に便利な方法。 コマンドプロンプトで dir /X を入力して削除したいフォルダーのショートネームを表示。 ショートネー…

(メモ) Ubuntu(16.0.4) Nginx, MySQL の自動起動の設定

Ubuntu(16.0.4)で起動時にNginx MySQL を自動起動設定する // nginx 自動起動 sudo /lib/systemd/systemd-sysv-install enable nginx // 有効化 sudo /lib/systemd/systemd-sysv-install disable nginx // 無効化 // mysql 自動起動 sudo /lib/systemd/syste…

Electron で jQuery やjQuery依存のライブラリを使用する方法

electronでjQueryとjQuery依存のライブラリを使おうとしたら未定義のエラーが出ました Uncaught ReferenceError: $ is not defined Uncaught ReferenceError: jQuery is not defined 下記の読み込み方では未定義のエラーになる <script src="./js/jquery.min.js"></script> これでうまく動きました <script> win</script>…

ElectronのgetAppPathとapp.getPathのパス出力

メモ electron v1.4.1 // windows console.log(app.getAppPath()); // 現在のアプリケーションディレクトリ console.log(app.getPath('home')); // C:\Users\ユーザー名 console.log(app.getPath('appData')); // C:\Users\ユーザー名\AppData\Roaming conso…