fkymy / ofton Goto Github PK
View Code? Open in Web Editor NEWarchived
archived
Yuske Fukuyama | 福山裕介 | fkymy.hatenablog.com ##### Hi, I'm Yuske. I’m a programmer from Tokyo. I solve problems using C, Rust, and Typescript. ##### こんにちは! 幼少期からインドやフィリピンに15年滞在。国際バカロレアを修了後日本に帰国し、慶應義塾大学に入学。株式会社ツクルバ、株式会社メルカリなどでのエンジニアインターンや創業期スタートアップの技術担当、42Tokyoを経てKinkaku株式会社を創業。CとRustが好きです。
required
required
required
参考URL?
参考になるかわかりませんが
→http://www.pojihiguma.com/entry/UserHeat-Review
設置するページのHTMLファイルの「」のタグ直前に取得した解析タグを設置します。
タグ↓
<script type="text/javascript"> (function(add, cla){window['UserHeatTag']=cla;window[cla]=window[cla]||function(){(window[cla].q=window[cla].q||[]).push(arguments)},window[cla].l=1*new Date();var ul=document.createElement('script');var tag = document.getElementsByTagName('script')[0];ul.async=1;ul.src=add;tag.parentNode.insertBefore(ul,tag);})('//uh.nakanohito.jp/uhj2/uh.js', '_uhtracker');_uhtracker({id:'uhdsA9tsSy'}); </script>yshkdの作業を初められるようにする.
https://www.codementor.io/devops/tutorial/getting-started-postgresql-server-mac-osx
https://www.digitalocean.com/community/tutorials/how-to-setup-ruby-on-rails-with-postgres
http://qiita.com/yh2020/items/8be3087004d100fe752b
https://www.postgresql.org/docs/8.1/static/sql-createrole.html
PostgreSQLとActiveRecord
http://edgeguides.rubyonrails.org/active_record_postgresql.html
CREATE ROLE oftonrails WITH CREATEDB LOGIN PASSWORD ‘’;
bin/rails runner 'puts ActiveRecord::Base.configurations’
psql postgres -U oftonrails
GRANT ALL PRIVILEGES ON DATABASE ofton_rails_development TO oftonrails;
GRANT ALL PRIVILEGES ON DATABASE ofton_rails_test TO oftonrails;
OR
ALTER ROLE rails_user WITH Superuser;
postgres=> \connect super_awesome_application
postgres=> \dt
postgres=> \q
required
git flow
project flow
required
required
https://stackoverflow.com/questions/38198668/rails-5-load-lib-files-in-production
required
e2461fd
deploy後healthに異常値
Instance ID i-000b0e4c39f025ec5 がdegraded
100 % of CPU is in use. とか..
eb ssh して topすると
直後は
その後
steal timeが異常
stとは?
http://blog.scoutapp.com/articles/2013/07/25/understanding-cpu-steal-time-when-should-you-be-worried
about
policy
http://jeromedalbert.com/how-dhh-organizes-his-rails-controllers/
required
https://www.docker.com/what-docker
http://qiita.com/pottava/items/7086f9d63487aa3d7d08
https://nickjanetakis.com/blog/dockerize-a-rails-5-postgres-redis-sidekiq-action-cable-app-with-docker-compose
http://dev.classmethod.jp/cloud/aws/deploy-rails-on-docker-to-elasticbeanstalk/
required
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/eb3-ssh.html
eb ssh
psql --host=aaaa763vh09vcj.c4qjmubauk0a.ap-northeast-1.rds.amazonaws.com --port=5432 --username=***** --password --dbname=****
to use psequel
https://medium.com/@michalisantoniou6/connect-to-an-aws-rds-using-an-ssh-tunnel-22f3bd597924
http://qiita.com/katsukii/items/c3df0653ac07d41fe03f
ssh -N -L 5432:aaaa763vh09vcj.c4qjmubauk0a.ap-northeast-1.rds.amazonaws.com:5432 [email protected] -i /path/to/identity
memo
\dt \du \list
select * from tablename
delete from tablename
required
required
required
required
required
required
required
app server: puma
web server: nginx (ebで用意)
db: RDS
assets: sprockets => precompiled and manifested in public
admin以外のフロントエンドをreact+reduxアプリにしたい
RailsとReactの関係性パターン
http://qiita.com/jwako/items/195e2e85793716fb1d53
<%= react_component('compName', props: { name: 'eyy' }) %>
的な
dev: foreman + webpack-dev-server
prod: static deployment to S3 + API server on EC2
root url to static js app, and react-router to take care of rest
*cra is designed for static deployment, and its the easiest way
疑問:
create-react-app, npm run build, static files in build directory, contents hosted by aws S3 or CloudFront deployed statically (what CRA is designed for, thus no SSR)
https://medium.com/@omgwtfmarc/deploying-create-react-app-to-s3-or-cloudfront-48dae4ce0af
https://www.fullstackreact.com/articles/how-to-get-create-react-app-to-work-with-your-rails-api/
https://www.fullstackreact.com/articles/deploying-a-react-app-to-s3/
https://www.fullstackreact.com/articles/deploying-a-react-app-with-a-server/
疑問:
dev: procfile.dev + foreman to start dev-server :3000 and api :3001
prod: app root has another package.json, postinstall => heroku + procfile web: rails s
https://blog.mismithportfolio.com/web/20170106rails-react#c
https://medium.com/superhighfives/a-top-shelf-web-stack-rails-5-api-activeadmin-create-react-app-de5481b7ec0b
foreman start rake task Procfile
Railsで構える.Railsにsrcディレクトリを作り、webpackでpublic/distにコンパイル.rootでjavascript_include_tag asset_path(‘bundle.js’) する
基本的にクライアントレンダーされ、そこからアクションに応じてrails apiにリクエストするイメージ.SSRする場合はrails側施策、hypernovaなどを利用することに?
rails標準はsprocketだけど、ES6使えないしnpmなし.その対応として:
browerify-rails(jsヘビーだとビルド遅い)
ビルドしたものをsprocketsのパスに突っ込む(Hot Module Replacement使えない)
sprocketsは使わず、ビルドは全部node npmの世界でやる.それをpublicに出力しrailsから読み込む
Sprocketsをwebpackで代替するためには:
digest付きのassetsを生成する
productionではJSを圧縮して生成する
webpackでCSSも生成する
Railsからwebpackの作成したJS / CSSを読み込む
digestのためにwebpack-manifest-pluginを使う
webpack が生成したファイルへのパスを返すヘルパーを定義しviewで使う
webpackでビルドしたものは:
直接ビルドしたものを public/ に置く
ビルドしたものを app/assets/javascripts に置いて、Sprocketsを通す
browserify-rails を使ってSprocketsで依存を解決する
の選択肢の中、1を採用し、manifest.jsonでrails側のjsファイル読み込みに対応.
JSやCSSのrails側読み込み
sprocket無しのwebpack, assets_path helper
ビルドは全てnodeの世界.
http://engineer.crowdworks.jp/entry/2016/05/24/174511
記事
easiest, 上参考
root /src
root webpack.config
bundle.js with manifest to public/dist/
http://qiita.com/UFO/items/3c4e6a323e86c0c64e04
ソースコード
https://github.com/ufotsuboi/rails-webpack-sample
similar to above
assets precompileのときにwebpackコンパイルをフックするtask書いてもよし
renderingとapi両方railsの場合react-rails gemいれとけというアドバイスが分からない
http://qiita.com/chimame/items/136d3a35b79e553a7f97
big example
https://github.com/shakacode/react-webpack-rails-tutorial#basic-demo-setup
hypernova
http://qiita.com/chimame/items/136d3a35b79e553a7f97
http://qiita.com/necojackarc/items/afa674ab10aafa9784eb
http://qiita.com/izumin5210/items/c642ae75f916d301456a
http://qiita.com/joker1007/items/9068e223744b3ac8c6dd#digest%E3%81%AE%E6%89%B1%E3%81%84
digestとかについて
https://github.com/kogoto/rails5-react-redux-todo
client/
https://github.com/georgediaz88/githopper/tree/master/frontend
https://github.com/Angelmmiguel/docker-rails5-react-redux-boilerplate
rails開発環境セットアップ
http://docs.aws.amazon.com/ja_jp/elasticbeanstalk/latest/dg/create_deploy_Ruby_rails.html
SEOについて
http://searchengineland.com/tested-googlebot-crawls-javascript-heres-learned-220157
うるさい
TODO:
pseudo user > user
self join comments
implement schema information to models
examples
https://github.com/discourse/discourse
https://github.com/diaspora/diaspora
enterprise structuring
https://dan.chak.org/enterprise-rails/chapter-1-the-big-picture/
controllers
http://postd.cc/how-dhh-organizes-his-rails-controllers/
structuring
https://karolgalanciak.com/blog/2013/10/06/structuring-rails-applications/
https://www.slideshare.net/masuda220/ss-59756718
others
http://trailblazer.to/
http://post.simplie.jp/posts/32
best practices
http://blog.carbonfive.com/2016/11/16/rails-database-best-practices/
service and form
http://a-suenami.hatenablog.com/entry/2013/12/06/092146
layer architecture
http://qiita.com/yuku_t/items/961194a5443b618a4cac
postgres
http://postgres-data-types.pvh.ca/#1
https://vimeo.com/61044807
required
required
required
required
required
required
atomic counter update
http://www.alfreddd.com/2011/01/atomic-increment-in-rails.html
post.increment! :comments_count
=>
UPDATE 'posts' SET 'posts_count' = 1 WHERE 'id' = 38
Post.increment_counter :posts_count , 38
=>
UPDATE 'posts' SET 'posts_count' = COALESCE('posts_count', 0) + 1 WHERE ( 'id'= 38)
required
BEMIT MindBEMing bembembem hungarian naming
https://csswizardry.com/2015/08/bemit-taking-the-bem-naming-convention-a-step-further/
https://csswizardry.com/2013/01/mindbemding-getting-your-head-round-bem-syntax/
https://csswizardry.com/2015/03/more-transparent-ui-code-with-namespaces/
Media Object
http://www.stubbornella.org/content/2010/06/25/the-media-object-saves-hundreds-of-lines-of-code/
OOCSS
https://github.com/stubbornella/oocss/wiki
required
https://stackoverflow.com/questions/4779963/how-can-i-access-my-localhost-from-my-android-device
required
required
required
問題有り
https://support.google.com/adwordspolicy/answer/6368661?hl=ja&authuser=0#673
custom error rendering
http://morizyun.github.io/blog/custom-error-404-500-page/
dynamic error rendering rambulance
http://morizyun.github.io/blog/rambulance-error-handling-ruby-gem-rails/
static rendering
https://medium.com/@tair/custom-error-pages-in-rails-you-re-doing-it-wrong-ba1d20ec31c0
論理削除
required
required
styleには変化なし、d2484ffコミットまで.
原因の投稿:
"
離婚して、家族を無くしました。
もう10年以上になります。
休日に家族連れやカップルや友達同士で遊びに行ってる人達を見ると、私には何もないって思います。自分がこんな風な40代を向かえてる事を受け入れられず、なんでこんな風になってしまったんだろう私の人生って、悲しい気持ちでいっぱいです。
子供の頃からずっと孤独との闘いです。こんな人生が早く終わりますように。
"
下にスペース連打されてる.
テストで連打してみてもエスケープされるから再現しようとしてもできない.
多分全角かな
投稿周りのエスケープ・改行・フォーム見直そ
https://ja.stackoverflow.com/questions/12894/%E5%85%A8%E8%A7%92%E8%8B%B1%E6%95%B0%E5%AD%97%E5%8F%8A%E3%81%B3%E7%A9%BA%E7%99%BD%E6%96%87%E5%AD%97%E3%82%92%E5%8D%8A%E8%A7%92%E3%81%AB%E5%A4%89%E6%8F%9B%E3%81%99%E3%82%8B%E6%96%B9%E6%B3%95
http://qiita.com/y-ken/items/d08eb7f66c8fb2fa7d21
http://qiita.com/y-ken/items/17181f322d0413edd3dc#comment-0e29423fc28020a63133
simple_format adds p already, 改行
http://d.hatena.ne.jp/nain/20100811/p16
required
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.