workflow:
$ rails g model NameOfModel
invoke active_record
create db/migrate/YYYYMMDDHHMMSS_create_name_of_models.rb| worker_processes auto; | |
| events { | |
| worker_connections 1024; | |
| } | |
| http { | |
| include mime.types; | |
| default_type application/octet-stream; |
| // Returns the value at a given percentile in a sorted numeric array. | |
| // "Linear interpolation between closest ranks" method | |
| function percentile(arr, p) { | |
| if (arr.length === 0) return 0; | |
| if (typeof p !== 'number') throw new TypeError('p must be a number'); | |
| if (p <= 0) return arr[0]; | |
| if (p >= 1) return arr[arr.length - 1]; | |
| var index = arr.length * p, | |
| lower = Math.floor(index), |