- Ruby Threads and ActiveRecord Connections
- http://jakeyesbeck.com/2016/02/14/ruby-threads-and-active-record-connections/
- http://vigram-software-generals.blogspot.tw/2014/03/ruby-threads-activerecord-too-many.html
- Ruby Concurrency and Parallelism: A Practical Tutorial
- Time
- ramhoj/time-zone-article#1
- http://www.elabs.se/blog/36-working-with-time-zones-in-ruby-on-rails
- Use
Time.zone.now
or Time.now.in_time_zone("Taipei").to_date - Transaction
- http://markdaggett.com/blog/2011/12/01/transactions-in-rails/
- raise ActiveRecord::Rollback will invalidate a transaction and reset the database records, won't bubbles up through the application stack
- Transactions are not distributed across database connections
- nested transaction
- Active Record emulates nested transactions by using savepoints on MySQL and PostgreSQL
- Others
- config pattern
- accepts_nested_attributes_for with Has-Many-Through Relations
- Is Ruby pass-by-reference or pass-by-value?
- rspec controller spec render_views
- scan
- http://stackoverflow.com/questions/1628673/ruby-regex-for-a-split-every-four-characters-not-working
- https://ruby-doc.org/core-2.2.0/String.html#scan-method
- Checking assoication exists
- filter attributes changes
attributes_changed_by_setter.except!(:foo, :bar)
- glob a directory in Ruby but exclude certain directories?
- Using heredoc for prettier Ruby code
- SSL Stuffs
- concurrency, parallal
- Actor
- Use specific mysql index with rails
- async/await
- es6 string interpolation
- http://stackoverflow.com/questions/21668025/react-jsx-access-props-in-quotes/30061326#30061326
{`images/${this.props.image}`}
- "use strict";
- http://www.ruanyifeng.com/blog/2013/01/javascript_strict_mode.html
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Strict_mode
- More serious rules, you could not write javascript whatever you want.
- namespace
- pattern example
- https://addyosmani.com/blog/essential-js-namespacing/
- Prevent double click script
- Window.location
- String.prototype.replace
- Object.assign
- https://developer.mozilla.org/zh-TW/docs/Web/JavaScript/Reference/Global_Objects/Object/assign
- JavaScript 的 Object.assign 陷阱
- onbeforeunload
- https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload
- http://stackoverflow.com/questions/30712377/jquery-beforeunload-custom-pop-up-window-for-leaving-a-page
- How to trigger a click on a link using jQuery
$('#test1')[0].click();
- handle array-like objects
- http://stackoverflow.com/questions/1424710/why-is-my-join-on-a-javascript-array-failing
- https://api.jquery.com/jQuery.makeArray/
- What does setTimeout with a 0ms delay do?
- Let some function be executed immediately right after after the currrent function
- JavaScript Promise 實作理解筆記
- npm install --save-dev vs npm --save
- What does -save-dev mean in npm install --save-dev
- What is yarn
- 取代 npm 的新利器 Yarn
- [譯] Yarn - Javascript 新一代套件管理
- Migrating from npm
- webpack
- webpack concept
- webpack configuration
- What does “publicPath” in webpack do?
- What is loader for?
- webpack僅能處理Javascript所以需要一些Loader來幫忙。例如,處理CSS檔案,我們需要使用style-loader。
- 如何使用 Webpack 模組整合工具
- WEBPACK入門教學筆記
- babel-loader jsx SyntaxError: Unexpected token
- even react need babel support
- babel presets
- styling
- Using Webpack in Rails with the Webpacker Gem Video
- import, export
- Why es6 react component works only with “export default”?
- ES6 - Convert from 'require' to 'import'
- ES6:
import * as React
vsimport React
- https://github.com/bonniee/learning-react-native
- https://www.youtube.com/playlist?list=PLb0IAmt7-GS0M8Q95RIc2lOM6nc77q1IY
- A cartoon intro to redux
- 2016-03-02 React.js Conf 回顧 @ Reactjs.tw 社群小聚 11
- require image in react-native
- What is data-react-checksum
- Rendering React Components on the Server
- Perform debounce in React.js
- React AJAX Best Practices
- React pattern
- Container Components
- Pass value in onClick
- Use setState callback to make sure state be updated
- React initialize flow diagram
- Reactjs Day 5 - Reactjs 大解密
- controlled & uncontrolled component
- ref
- [Reactjs] 關於 Refs
- 不要在 render() 方法裡面使用 this.refs 或者當任何元件的 render() 正在運行的時候。
- Using ref Attribute
- [Reactjs] 關於 Refs
- Higher order component
- ES6篇 - let與const
- ES6篇: Module System(模組系統)
- ES6篇 - Class(類別)
- Destructuring Assignment(解構賦值)
- reactconf-2017
- redux
- A cartoon intro to redux(https://code-cartoons.com/a-cartoon-intro-to-redux-3afb775501a6)
- When you have multiple servers for app, workers, search etc... and you have a upgrade like rails 4.1 to rails 4.2. You need to be careful of the different version of these servers. Like Rails 4.2 app, Rails 4.1 worker(app finished deployment first). It may has some problems and you probably need to deploy workers first.
- Take care of the asset when you use auto-scale, the easist way to avoid any problem, expire everything
Rails.application.config.assets.version = "1.1"
- mysql explain
- http://emn178.pixnet.net/blog/post/83011289-mysql-explain---%E6%95%88%E8%83%BD%E5%88%86%E6%9E%90%E8%AA%9E%E5%8F%A5
- rows lower is better
- http://fecbob.pixnet.net/blog/post/39084799-mysql-%E4%B8%ADexplain%E7%9A%84%E7%94%A8%E6%B3%95
- http://database.51cto.com/art/201108/285710_all.htm
type
: from good -> bad. const、eq_reg、ref、range、indexhe then ALLpossible_keys
: when it is empty, it means no possible indexeskey
: what query be usedkey_len
lower is better- Why Postgres Won't Always Use an Index
- selec * for update
- https://gist.github.com/ilake/f163ccf349fdc288e009
- http://api.rubyonrails.org/classes/ActiveRecord/Locking/Optimistic.html
- http://stackoverflow.com/questions/21404484/rails-3-how-to-simply-test-pessimistic-locking-on-console
- Prevent MySQL deadlocks in your Rails application
- MySQL locking for the busy web developer
- Select where first letter in a range ( PostgreSQL )
- Determine Whether Two Date Ranges Overlap
- GROUP BY multiple columns using MySQL
- postgresql time/date
- compare only time/date part of dateime
- 8 PostgreSQL Date and Time Function Examples
- now(), now()::date, now()::time, date_part(), age(), extract(), date_trunc(), to_char(), to_timestamp()
- 4 Tips for Working with Dates in PostgreSQL
- now, extract, interval, clock_timestamp
- 9.9. Date/Time Functions and Operators
- PostgreSQL search
- Using COALESCE to handle NULL values in PostgreSQL
- COALESCE, NULLIF
- Difference between LIKE and ~ in Postgres
- How to Create Postgres Indexes Concurrently in ActiveRecord Migrations
- Postgresql tr_gram, Trgrams
- Faster PostgreSQL Searches with Trigrams
- Fast Search Using PostgreSQL Trigram Indexes
- Awesome Autocomplete: Trigram Search in Rails and PostgreSQL
- similarity, ActiveRecord::Base.connection.quote
- PostgreSQL扩展pg_trgm用法笔记
- N-gram是计算机语言学和概率论范畴内的概念,是指给定的一段文本或语音中N个项目(item)的序列。项目(item)可以是音节、字母、单词或碱基对。通常N-grams取自文本或语料库。 N=1时称为unigram,N=2称为bigram,N=3称为trigram,以此类推
- 利用pg_trgm的gist和gin索引加速字符匹配查詢
- pg_trgm的工作原理是把字符串切成N個3元組,然後對這些3元組做匹配,所以如果作為查詢條件的字符串小於3個字符它就罷工了。
- 如何用PostgreSQL解決一個人工智能語義去重的小問題
- 從難纏的模糊查詢聊開 - PostgreSQL獨門絕招之一 GIN , GiST , SP-GiST , RUM 索引原理與技術背景
- 从相似度算法谈起 - Effective similarity search in PostgreSQL
- Use Subqueries to Count Distinct 50X Faster
- collection
- The Difference Between ID and Class
- Adjacent sibling selectors, what plus + symbol means in css
- About line-height
- Ruby 語法放大鏡之「你知道 require 幫你做了什麼事嗎?」
- Ruby class instance variable vs. class variable
- How Do I Know Whether My Rails App Is Thread-safe or Not?
- CSS display:inline vs inline-block
- code smell
- content too long
- http://note.tc.edu.tw/714.html
word-wrap: break-word; overflow: hidden;
- WebSockets From Scratch
- https://blog.pusher.com/websockets-from-scratch/
- CSS Order Priority
- Understanding offsetWidth, clientWidth, scrollWidth and -Height
- https://developer.mozilla.org/zh-TW/docs/Web/API/Element/scrollWidth
- css transition
- https://jsfiddle.net/ilake/jyhLqvuy/17/
- http://css3.bradshawenterprises.com/accordions/
- css text-transform
- HTML property vs attributes
- http://stackoverflow.com/questions/6003819/properties-and-attributes-in-html
- http://stackoverflow.com/questions/19246714/html-attributes-vs-properties
- http://stackoverflow.com/questions/5874652/prop-vs-attr
- vertical-align sample, vertical-align-sampe-2
- viewpoint height - Make div 100% height of browser window
- Move js event to first
- glob a directory in Ruby but exclude certain directories?
- xml nokogiri example
- xml find with namespace
- What does “xmlns” in XML mean?
- Momentum Scrolling on iOS Overflow Elements
- mysqldump special character issue
- Bootstrap modal appearing under background in mobile
- ios scroll disapper issue
- iPad Safari - Make keyboard disappear
- heroku scale
- 1 to 1000 - Scaling a Rails App on Heroku
- Scaling Rails to 125,000 Requests per Minute on Heroku
- [git merge conflict automatic resolution]
- git merge -s recursive -X theirs source_branch
- git merge -Xours B
- use google font
- import https://fonts.google.com/earlyaccess#Noto+Sans+JP
- download https://www.google.com/get/noto/#sans-jpan
- use in rails, heroku
- http://qiita.com/tochi/items/0d61bceef241d4fce07e
- put font files under .fonts folder, Heroku understand it.
- https://reinteractive.com/posts/270-wickedpdf-and-custom-fonts-in-rails
- http://qiita.com/tochi/items/0d61bceef241d4fce07e
- resize icons
- https://www.ptt.cc/bbs/Soft_Job/M.1455389052.A.586.html
- https://www.ptt.cc/bbs/Soft_Job/M.1455442899.A.61B.html
- http://buzzorange.com/techorange/2015/07/28/coder-brand/
- interview