This blogpost shows how to setup Rails 6 with Bootstrap 4.
This snippet shows a somehow different and less customized approach.
$ rails new rails6-bootstrap4
$ bundle --binstubs
$ yarn add bootstrap jquery popper.js expose-loader
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks. | |
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/) | |
(() => { | |
const SHOW_SIDES = false; // color sides of DOM nodes? | |
const COLOR_SURFACE = true; // color tops of DOM nodes? | |
const COLOR_RANDOM = false; // randomise color? | |
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com) | |
const MAX_ROTATION = 180; // set to 360 to rotate all the way round | |
const THICKNESS = 20; // thickness of layers | |
const DISTANCE = 10000; // ¯\\_(ツ)_/¯ |
$red: ( | |
"base": #F44336, | |
"lighten-5": #FFEBEE, | |
"lighten-4": #FFCDD2, | |
"lighten-3": #EF9A9A, | |
"lighten-2": #E57373, | |
"lighten-1": #EF5350, | |
"darken-1": #E53935, | |
"darken-2": #D32F2F, | |
"darken-3": #C62828, |
<%= form_with(model: billboard) do |form| %> | |
<%= tag.div class: "dropzone", data: { controller: "dropzone", dropzone_param_name_value: "billboard[images][]", dropzone_url_value: rails_direct_uploads_url, dropzone_accepted_files_value: "image/*", dropzone_max_files_value: 3, dropzone_max_filesize_value: 0.300 } do %> | |
<div class="dz-default dz-message flex flex-col items-center"> | |
<%= image_tag "upload.svg", size: 28, class: "colorize-black", aria: { hidden: true } %> | |
<h5 class="font-semibold mbs-4">Drop files here or click to upload.</h5> | |
<p class="text-sm text-subtle">Upload up to 10 files.</p> | |
</div> | |
<% end %> | |
<div class="inline-flex items-center mbs-2 mie-1"> |
This blogpost shows how to setup Rails 6 with Bootstrap 4.
This snippet shows a somehow different and less customized approach.
$ rails new rails6-bootstrap4
$ bundle --binstubs
$ yarn add bootstrap jquery popper.js expose-loader
round.off <- function (x, digits=0) | |
{ | |
posneg = sign(x) | |
z = trunc(abs(x) * 10 ^ (digits + 1)) / 10 | |
z = floor(z * posneg + 0.5) / 10 ^ digits | |
return(z) | |
} |
HTTP status code symbols for Rails | |
Thanks to Cody Fauser for this list of HTTP responce codes and their Ruby on Rails symbol mappings. | |
Status Code Symbol | |
1xx Informational | |
100 :continue | |
101 :switching_protocols | |
102 :processing |
// iMacro CheatSheet - Command Reference | |
// http://wiki.imacros.net/Command_Reference | |
// iMacros supports 3 types of variables: | |
// * The macro variables !VAR0 thru !VAR9. They can be used with the SET and ADD command inside a macro. | |
// * Built-in variables. They contain certain values set by iMacros. | |
// * User-defined variables. They are defined in-macro using the SET command. | |
#HWplot.R | |
library(ggplot2) | |
library(reshape) | |
HWplot<-function(ts_object, n.ahead=4, CI=.95, error.ribbon='green', line.size=1){ | |
hw_object<-HoltWinters(ts_object) | |
#Plot data using ggplot2 | |
library(ggplot2) | |
#Combine year/month/day together into POSIX | |
pageviews_w_forecast$date <- ISOdate(pageviews_w_forecast$year, pageviews_w_forecast$month, pageviews_w_forecast$day) | |
#Convert columns to numeric | |
pageviews_w_forecast$pageviews <- as.numeric(pageviews_w_forecast$pageviews) | |
pageviews_w_forecast$pageviews_upper <- as.numeric(pageviews_w_forecast$pageviews_upper) | |
pageviews_w_forecast$pageviews_lower <- as.numeric(pageviews_w_forecast$pageviews_lower) |