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.
Forget what you know about Javascript MVC patterns from your experience with Backbone, Ember, Angular, Knockout, Batman, and yada yada. I encourage you to empty your cup, take a step back and open your mind to the ideas presented in the following resources, primarily from minds of Nicholas Zakas and Addy Osmani, two individuals I consider to be thought leaders in the front-end development world.
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(); |
var express = require('express'); | |
var app = express.createServer(); | |
app.configure(function() { | |
var pub = __dirname + "./public"; | |
pub = require("path").normalize(pub); | |
app.set('views', __dirname + '/views'); | |
app.set('view engine', 'jade'); | |
}); |
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" } |
console.log('initializer hello.js'); |
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 |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>You are not connected to the Internet</title> | |
<meta name="viewport" content="width=device-width,initial-scale=1"> | |
<style> | |
body { | |
background-color: #EFEFEF; | |
color: #2E2F30; | |
text-align: center; |
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 ' |