$ echo 'gem "webpacker"' >> Gemfile
$ bundle install
$ rails webpacker:install
$ yarn add [email protected] jquery popper.js
diff --git a/config/webpack/environment.js b/config/webpack/environment.js
index d16d9af..86bf1a7 100644
/* | |
******************************************************************************** | |
Golang - Asterisk and Ampersand Cheatsheet | |
******************************************************************************** | |
Also available at: https://play.golang.org/p/lNpnS9j1ma | |
Allowed: | |
-------- | |
p := Person{"Steve", 28} stores the value |
var util = require('util'), | |
http = require('http'), | |
events = require('events'); | |
var Twitter = function(opts) { | |
this.username = opts.username; | |
this.password = opts.password; | |
this.track = opts.track; | |
this.data = ''; | |
}; |
$ echo 'gem "webpacker"' >> Gemfile
$ bundle install
$ rails webpacker:install
$ yarn add [email protected] jquery popper.js
diff --git a/config/webpack/environment.js b/config/webpack/environment.js
index d16d9af..86bf1a7 100644
Latency Comparison Numbers | |
-------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
// ES6 w/ Promises | |
// Note: From a React starter template - see https://t.co/wkStq8y3I5 | |
function fetchData(routes, params) { | |
let data = {}; | |
return Promise.all(routes | |
.filter(route => route.handler.fetchData) | |
.map(route => { | |
return route.handler.fetchData(params).then(resp => { | |
data[route.name] = resp; |
{ | |
"AL": "Alabama", | |
"AK": "Alaska", | |
"AZ": "Arizona", | |
"AR": "Arkansas", | |
"CA": "California", | |
"CO": "Colorado", | |
"CT": "Connecticut", | |
"DE": "Delaware", | |
"FL": "Florida", |
# Run from 'rails console' | |
# Example cookie value. To find in Chrome: Inspect > Resources > Cookies | |
cookie = "cEJPOHAwUXdmMS9HK3gyVVYyNVR2QU03Q0ZhclZYNmRrN3RoelhrenQ3ZVhsSEtOTytQR29aZG1ZZWZmK254Y01QM2hyTVZMNlFOcWNCRytzM0pac0hpbFVWTUoxZEVicEZERXIzbEJENkJ4QVBZcDQyM24rclQxbnRFeXpkMVRicTdGMkVSU2F1U0FVcEdiYVBsRVFveThlMndPdDBlaThVVkl4TkFreUc0PS0tRFFmdlFzQnkrSmROT1ZNdnpjcnA4Zz09--3bf330ec809351525bd9df2c905a81a3bcc93c81" | |
# Example secret_key_base found in config/secrets.yml | |
secret_key_base = "df3def2698eb651febcb5ca64c3203a3cb3ff988e7ee5c4fd66135a24ddf5009ae0f95dee1e1d2e443538e647178f0cd87acc98d1082659bb03d89b8af1f2252" | |
key_generator = ActiveSupport::KeyGenerator.new(secret_key_base, iterations: 1000) | |
secret = key_generator.generate_key("encrypted cookie") | |
sign_secret = key_generator.generate_key("signed encrypted cookie") | |
encryptor = ActiveSupport::MessageEncryptor.new(secret, sign_secret, serializer: ActiveSupport::MessageEncryptor::NullSerializer) | |
puts encryptor.decrypt_and_verify(URI.unescape(cookie)) |
require 'bundler/capistrano' | |
require 'capistrano_colors' | |
load 'deploy/assets' | |
# ssh forwarding and shell | |
set :default_run_options, { :pty => true } | |
set :ssh_options, { :forward_agent => true } | |
set :scm_verbose, true | |
set :scm, :git |
Using Ruby on Rails we would like you to create a simple expert search tool. The application should fulfill the requirements below. The source code must be placed in a public repo on GitHub. The application should be deployable on Heroku.