(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| ## Installing the NodeSource Node.js 10.x repo... | |
| ## Populating apt-get cache... | |
| + apt-get update | |
| Hit:1 http://deb.debian.org/debian buster InRelease | |
| Hit:2 http://security.debian.org/debian-security buster/updates InRelease | |
| Hit:3 http://deb.debian.org/debian buster-updates InRelease | |
| Ign:4 https://dl.bintray.com/fullstaq/fullstaq-ruby-apt debian-10 InRelease |
| $ heroku login | |
| # remember heroku instance is wellplayed with platform below | |
| $ bundle lock --add-platform x86_64-linux --add-platform ruby | |
| # remember postgres is wellplayed too | |
| $ rails new app --database=postgresql | |
| Assume you push already |
| #fullstaq-ruby enables malloc-trim and jemalloc which is said to save up to 50% memory consumption | |
| #ARG RUBY_VERSION=2.6.6-jemalloc | |
| #FROM quay.io/evl.ms/fullstaq-ruby:${RUBY_VERSION}-slim | |
| FROM swipesense/ruby-jemalloc:2.6-buster-slim | |
| ENV LANG C.UTF-8 | |
| ENV DEBIAN_FRONTEND noninteractive | |
| # Specify JP mirror, other mirrors are less stable than JP's | |
| RUN echo 'deb http://ftp.jp.debian.org/debian/ buster main contrib non-free' > /etc/apt/sources.list |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| ruby '2.7.1' | |
| gem 'rails', github: 'rails/rails' | |
| gem 'tzinfo-data', '>= 1.2016.7' # Don't rely on OSX/Linux timezone data | |
| # Action Text | |
| gem 'actiontext', github: 'basecamp/actiontext', ref: 'okra' | |
| gem 'okra', github: 'basecamp/okra' | |
| # Drivers |
| // non param lambda as a method | |
| def insert_sql | |
| -> (controller, action, title, url, user_id) { | |
| ActiveRecord::Base.connection.execute <<~SQL, [controller, action, title, url, user_id] | |
| insert into dummy(controller, action, title, url, user_id, created_at, updated_at) | |
| values( | |
| $1, | |
| $2, | |
| $3, | |
| $4, |
| # frozen_string_literal: true | |
| require "spec_helper" | |
| describe PgSearch::Multisearch do | |
| with_table "pg_search_documents", &DOCUMENTS_SCHEMA | |
| with_model :MultisearchableModel do | |
| table do |t| | |
| t.string :title |
| files: | |
| "/opt/elasticbeanstalk/hooks/appdeploy/pre/09_yarn.sh" : | |
| mode: "000755" | |
| owner: root | |
| group: root | |
| content: | | |
| #!/usr/bin/env bash | |
| set -xe | |
| EB_SCRIPT_DIR=$(/opt/elasticbeanstalk/bin/get-config container -k script_dir) |
| function mapValues(obj, fn) { | |
| return Object.keys(obj).reduce((result, key) => { | |
| result[key] = fn(obj[key], key); | |
| return result; | |
| }, {}); | |
| } | |
| function pick(obj, fn) { | |
| return Object.keys(obj).reduce((result, key) => { | |
| if (fn(obj[key])) { |
| files: | |
| '/etc/nginx/conf.d/01_proxy.conf': | |
| mode: '000644' | |
| owner: root | |
| group: root | |
| content: | | |
| client_max_body_size 10M; | |
| '/etc/nginx/default.d/01_locations.conf': | |
| mode: '000644' | |
| owner: root |