Google アカウント ユーザ認証
イシュー
- Google アカウント関連の確認
参考
- Google Cloud Platform
- google developers console へのログイン画面
- Using OAuth 2.0 for Web Server Applications | Google Identity Platform | Google Developers
- Using OAuth 2.0 to Access Google APIs | Google Identity Platform | Google Developers
- OpenID Connect | Google Identity Platform | Google Developers
- Google Identity Platform | Google Developers
- Googleのアカウントを利用してユーザ登録、ログインページを作成する(OAuth認証) | 菊地崇仁ブログ「ポイ探社長のブログ」
- 管理コンソールで API アクセスを有効にする - G Suite 管理者 ヘルプ
- Google アカウントを利用したユーザー認証 - Google App Engine 入門
「no application name」エラー
- application name を登録する必要がある
参考
Sails のmoduleについて
イシュー
- Sails でソーシャルログインできるまで作りたい
- とりいそぎ、passportモジュールでソーシャルログインを実装してみる
linker ?
- v.0.10.x で特に必要でなくなったっぽい
参考
- sails.js - SailsJS v0.10 create new project --linker not working Gruntfile.js not used - Stack Overflow
Sails v0.10 no longer uses the linker folder--it was just causing confusion. If you have the linker option enabled, then any assets under your assets folder will be copied over to your .tmp/public folder by Grunt when Sails is lifted.
Salis v0.10はもはやlinker フォルダを使用しない - それだけで混乱を引き起こしていた。 もしlinkerオプションが有効になっている場合は、つぎにSails を持ち上げた時に、Grunt によってasset フォルダの下にあるファイル群が .tmp/public フォルダにコピーされます。
Cannot find module 'passport'
- npm install で解消
$ npm install passport passport@0.2.0 node_modules/passport ├── pause@0.0.1 └── passport-strategy@1.0.0 $
参考
heroku 上で module 使うには?
2014-08-02T06:40:24.376739+00:00 app[web.1]: debug: Lowering sails... 2014-08-02T06:40:25.300905+00:00 app[web.1]: > sails-sb1@0.0.0 start /app 2014-08-02T06:40:25.300887+00:00 app[web.1]: 2014-08-02T06:40:25.300909+00:00 app[web.1]: 2014-08-02T06:40:25.300908+00:00 app[web.1]: > node app.js 2014-08-02T06:40:25.596154+00:00 app[web.1]: 2014-08-02T06:40:25.596164+00:00 app[web.1]: module.js:340 2014-08-02T06:40:25.596165+00:00 app[web.1]: throw err; 2014-08-02T06:40:25.596167+00:00 app[web.1]: ^ 2014-08-02T06:40:25.596169+00:00 app[web.1]: Error: Cannot find module 'passport' 2014-08-02T06:40:25.596173+00:00 app[web.1]: at Module.require (module.js:364:17) 2014-08-02T06:40:25.596174+00:00 app[web.1]: at require (module.js:380:17) 2014-08-02T06:40:25.596171+00:00 app[web.1]: at Function.Module._load (module.js:280:25) 2014-08-02T06:40:25.596176+00:00 app[web.1]: at Object.<anonymous> (/app/config/passport.js:1:78) 2014-08-02T06:40:25.596177+00:00 app[web.1]: at Module._compile (module.js:456:26) 2014-08-02T06:40:25.596178+00:00 app[web.1]: at Object.Module._extensions..js (module.js:474:10) 2014-08-02T06:40:25.596180+00:00 app[web.1]: at Module.load (module.js:356:32) 2014-08-02T06:40:25.596182+00:00 app[web.1]: at Function.Module._load (module.js:312:12) 2014-08-02T06:40:25.596170+00:00 app[web.1]: at Function.Module._resolveFilename (module.js:338:15) 2014-08-02T06:40:25.607768+00:00 app[web.1]: npm ERR! sails-sb1@0.0.0 start: `node app.js`
- package.json で、実行可能なscriptを記述できるので、grunt タスクをつくって、その中で" npm install --production " してやればいいっぽい
- とりあえず、node_modules をコミットしてもいける(けどキャッシュされてしまう)
参考
- node.js - How to deploy node app that uses grunt to heroku - Stack Overflow
- Heroku Node.js Support | Heroku Dev Center
- Building a sails application ep26 - Deploying a sails app to Heroku. - sailsCasts
- javascript - How to connect to Heroku Postgresql from Sails.js Java Script - Stack Overflow
- Herokuでnode.jsアプリ立ち上げてみるログ ::ハブろぐ
- 橋本商会 » Node.jsに入門して画像チャットを作ってHerokuで動かした
- grunt-heroku-deploy
- How to deploy a Grunt Project on Heroku? — Medium
- module load issue while deploying to Heroku · Issue #54 · balderdashy/sails-mongo · GitHub
- grunt-heroku-deploy
- Heroku Node.js Support | Heroku Dev Center
- heroku config:set で、PATHとNODE_ENV 設定しておいたら、node_modules をコミットしなくてもいいのか(要確認)
- JavaScript - Sails+Passport+Passport-Google-OAuthでOAuthをする場合 - Qiita
- ElasticBeanstalk - AWS Elastic Beanstalk+Node.js+Express+Passport+MySQLでアカウント管理(その5) - Qiita
- sailsCasts Answers: Ep7: How do I create a restful json CRUD api in sails from scratch? - sailsCasts
- sails の blueprint による api
- sailsCasts Answers: Ep8 - How do blueprint: actions and blueprint: routes work in sails? - YouTube
- blueprint で apiの実装が不要になる。万歳
heroku addon
heroku addons:add heroku-postgresql
Salesforce の名姓を姓名に変更するには
イシュー
- Salesforce Developer Editionを使っているとデフォルトで姓と名が逆に表示される(欧米か!)
参考
- 「Salesforce 氏名 表示順」「Salesforce 氏名 順番」「Salesforce 敬称 姓 名」「セールスフォース 表示順 変更」で調べたけど見つからない。。
- Salesforce.com Help Portal
- ヘルプも5ページぐらい眺めたが、出てくる気配がない
なんか勘違いっぽい
- FirstName(姓) と LastName(名)でデータ送ってしまっている?
どんどんしよう、リファクタリング
イシュー
- 何に気を付けてリファクタリングしていけばいいかのメモ
やってはいけないこと
- テストがない状態でリファクタリングすると、100%デグるので絶対やってはいけない。
リファクタリングの着目点
手続きの整理
- メソッドの上の方に処理の流れを項番付きでコメントを書く
- 項番付きで処理を記載する
2つ以上の処理の共通化
- 同じ処理があったらprivateメソッドで外だしして共通化する
- 共通化した処理で、戻したい変数が2つ以上あり、それを本体で使いたい場合はメンバ変数を使う
- メンバ変数よりもほんとはタプルで処理を返したほうがいい
- privateメソッド内で分岐はしない(それは共通処理ではないということだから)
SQLの発行回数をへらす
- SQLはループの中で発行しない、いったんMapに格納する
- 必ずWHERE句をつける(全件取得しない)
- 関連テーブルは、いったんIDのSetを作成する
全面修正を恐れない
- リファクタリング時は最初に作成したときの10倍の速度でプログラムを作れるから、全面修正となったとしても恐れない。(ただしテストある時に限る)
参考
東洋的思考と西洋的思考
イシュー
- 東洋と西洋の考え方の違いについてのまとめ
- 日本では、LinuxやiPhoneのようなシステマティックな製品を生み出せず、ガラケーやニコ動などのコンテンツ中心の製品となってしまう。
- ガラケーはシステムになれず、独自文化と化したコンテンツとしてとらえている
- それ自体は特徴であり悪いことではなく、逆に真理をつく強みであると考える
参考
- 西洋の考え方、東洋の考え方その最も大きな違い | HBR.ORG翻訳マネジメント記事|DIAMOND ハーバード・ビジネス・レビュー
- 「中国人は大きなものから小さいものへと考えますが、西洋人は小さなものから大きなものへと考えます。たとえば住所を書く時、中国人は省、都市名、地区、街区、番地の順に書きますが、西洋人はその逆に書きます。」
PCが遅すぎるので、バックグラウンドプロセスの見直し
イシュー
- 支給PCがすごい遅くて、再起動に15分ぐらいかかる場合がある。
- 基本的にメモリ足りない、常にHDDにアクセスいっている状態
- 一応メモリは4.00GBある(Windows7 Professional)
msconfig結果
- スタートアップ時にいろいろプログラムを起動しているのでいらないものは無効化する。
名前 | command | 備考 |
---|---|---|
Realtek HD オーディオマネージャ | RAVCpl64.exe | |
HD Audio Background Process | RAVBg64.exe | |
Intel(R) Coommon User Interface | igfxtray.exe | |
Intel(R) Coommon User Interface | hkcmd.exe | |
Intel(R) Coommon User Interface | igfxpers.exe | |
Synaptics Pointing Device Driver | ||
Think Vantage Active Protection System | ||
microsoft Office IME 2010 | IMEKLMG.EXE | |
Google Drive | ||
Google Update | ||
RCIMGDIR | ||
Intel(R) USB 3.0 Monitor | ||
Intel(R) PIconStartup | ||
ThinkPad Power Manager | ||
Trend OfficeScan ImageSetup | ||
Trend Micro Office Scan | ||
Adobe CS5 Service Manager | ||
SBSV 2010/02/19-11:02:07 | ||
Adobe Acrobat | ||
AcroTray - Adobe Acrobat Distiller helper application. | ||
Adobe Reader and Acrobat Manager | ||
Utility | DATA01-04_Utility.exe | |
TODO: |
TempDelete.exe | |
Microsoft Office IME 2010 | IMEKLMG.EXE | |
Chatter Desktop | ||
Evernote | ||
fenrir.exe | ||
McAfeeSecurity Scanner | ||
PGP Try |
見直しポイント
- microsoft Office IME 2010 が2回起動されている。
- スタートアッププログラムが、2箇所で動いている(Microsoft, Wow6432)
- Wow6342 は、Windows 32-bit On Windows 64-bit
- WOW64 - Wikipedia
- WOW64 の影響を受けるレジストリ キー (Windows)
- セキュリティソフトが、Trend MicroとMcAfeeの2つ動いている
よく分からんプロセスについて
そろそろ SSD への換装もまじめに考えたい
参考
Chromeのメモリ解放エクステンション
- 快適すぎる!Chromeのメモリを解放してくれるタブ拡張機能5個まとめ
- Google Chromeの消費メモリを95%節約してくれる拡張機能「OneTab」 - izmaker Today|映像・CG・サウンド・カメラ・デザイン
参考
- Windows7の起動(立ち上がり)が遅い時はこれで改善!! | Web起業手帳
- Microsoft Windows 7 - コンピューターの起動に時間がかかる場合の対処方法 | HP®カスタマーサポート
- コンパネの「パフォーマンスの問題を確認する」から起動プログラムを選択できる
- Microsoft Windows 7 - トラブルシューティング機能を使う方法 | HP®カスタマーサポート