I like jumping into tutorials first.
- Agile Web Development with Rails, I learned Rails with an older edition of this book
- The Rails Tutorial, The most popular Rails tutorial before it became a paid resource, "The Hartl Tutorial"
I like jumping into tutorials first.
| import puppeteer from 'puppeteer'; | |
| const [, , url, folder = '.'] = process.argv; | |
| if (!url) throw 'Must supply URL'; | |
| (async () => { | |
| const browser = await puppeteer.launch({ headless: 'new' }); | |
| const page = await browser.newPage(); |
| FactoryBot.define :stripe_customer, class: Hash do | |
| skip_create | |
| initialize_with { new(attributes) } | |
| id { "cus_#{SecureRandom.hex(7)}" } | |
| object { "customer" } | |
| address { nil } | |
| balance { 0 } | |
| created { 1.day.ago.to_i } | |
| currency { "usd" } |
| ConfigObject { | |
| mode: 'development', | |
| output: { | |
| filename: 'js/[name]-[contenthash].js', | |
| chunkFilename: 'js/[name]-[contenthash].chunk.js', | |
| hotUpdateChunkFilename: 'js/[id]-[hash].hot-update.js', | |
| path: '/path/to/rails/app/public/packs', | |
| publicPath: '/packs/', | |
| pathinfo: true | |
| }, |
| require "benchmark" | |
| require "open-uri" | |
| require "pathname" | |
| n = 1_000 | |
| Benchmark.bm do |benchmark| | |
| benchmark.report("open(url).read") do | |
| n.times do | |
| open("http://localhost:3035/packs/manifest.json").read |
| PROMPT_PREFIX="%{$fg[blue]%}[%{$reset_color%}" | |
| PROMPT_SUFFIX="$fg[blue]%}]%{$reset_color%}" | |
| HOST_PROMPT="%{$fg_bold[green]%}%n@%m" | |
| DATE_PROMPT="$PROMPT_PREFIX%{$fg[red]%}%D{%I:%M:%S}$PROMPT_SUFFIX" | |
| PWD_PROMPT="$PROMPT_PREFIX%{$fg[white]%}%~$PROMPT_SUFFIX" | |
| LEADER_PROMPT="%{$fg_bold[blue]%}\$%{$reset_color%}" | |
| PROMPT=$'$HOST_PROMPT $DATE_PROMPT$PWD_PROMPT$RUBY_PROMPT$(git_prompt_info)\ | |
| $LEADER_PROMPT ' |
| Capybara starting Puma... | |
| * Version 3.12.0 , codename: Llamas in Pajamas | |
| * Min threads: 0, max threads: 4 | |
| * Listening on ssl://127.0.0.1:61719?key=/Users/ross/dev/learnzillion/system-test-demo/config/ssl/ssl-lvh.me.key&cert=/Users/ross/dev/learnzillion/system-test-demo/config/ssl/ssl-lvh.me.crt | |
| 2018-08-16 10:52:20 -0400: SSL error, peer: 127.0.0.1, peer cert: , #<Puma::MiniSSL::SSLError: OpenSSL error: error:1407609C:SSL routines:SSL23_GET_CLIENT_HELLO:http request - 336027804> | |
| 2018-08-16 10:52:21 -0400: SSL error, peer: 127.0.0.1, peer cert: , #<Puma::MiniSSL::SSLError: OpenSSL error: error:1407609C:SSL routines:SSL23_GET_CLIENT_HELLO:http request - 336027804> | |
| 2018-08-16 10:52:21 DEBUG Selenium Executing Process ["/Users/ross/.gem/ruby/2.4.1/bin/chromedriver", "--port=9515"] | |
| 2018-08-16 10:52:21 DEBUG Selenium polling for socket on ["127.0.0.1", 9515] | |
| 2018-08-16 10:52:22 DEBUG Selenium polling for socket on ["127.0.0.1", 9515] | |
| Starting ChromeDriver 2.34.522932 (4140ab217e1ca1bec0c4b4d1b148f3361eb3a03e) on por |
| import range from 'lodash/range' | |
| import('pdfjs/dist').then(pdfjs => { | |
| pdfjs | |
| .getDocument('wibble.pdf') | |
| .then(pdf => { | |
| const pagePromises = range(1, pdf.numPages).map(number => pdf.getPage(number)) | |
| return Promise.all(pagePromises) | |
| }) | |
| .then( |