$ rails new APP_NAME -d postgresql --skip-action-mailbox --skip-action-text --skip-spring --webpack=react -T --skip-turbolinks
# config/application.rb
config.generators do |g|
g.test_framework false
g.stylesheets false
$ rails new APP_NAME -d postgresql --skip-action-mailbox --skip-action-text --skip-spring --webpack=react -T --skip-turbolinks
# config/application.rb
config.generators do |g|
g.test_framework false
g.stylesheets false
if (!Date.prototype.toDatetimeLocal) { | |
(function () { | |
Date.prototype.toDatetimeLocal = function () { | |
var date = this | |
var ten = function (i) { | |
return (i < 10 ? '0' : '') + i; | |
} | |
if (date == 'Invalid Date') return false |
for file in app/views/**/*.erb; do html2haml -e $file ${file%erb}haml && rm $file; done
export function deepOmit(obj, excludes) { | |
const result = {} | |
excludes = Array.isArray(excludes) ? excludes : [excludes] | |
for (let i in obj) { | |
if (Array.isArray(obj[i])) { | |
const nextValue = obj[i].map(arrItem => { | |
if (isObject(arrItem)) { | |
return deepOmit(arrItem, excludes) | |
} |
export function brainstore() { | |
let store = {} | |
let listeners = [] | |
let ownProp = Object.prototype.hasOwnProperty | |
let allowed = { | |
string: 1, | |
number: 1, | |
boolean: 1, | |
object: 1, | |
function: 0, |
Sandbox.modules = {} | |
Sandbox.modules.vnode = function(s) { | |
s.vnode = {} | |
} | |
Sandbox.modules.createElement = function(s) { | |
s.createElement = function() {} | |
} |
# frozen_string_literal: true
namespace :import do
desc 'import CSV'
task csv: :environment do
csv_file = File.join Rails.root, 'tmp/file.csv'
counter = 0
options = {
# ... | |
activate :external_pipeline, | |
name: :webpack, | |
command: build? ? "npm run build:assets" : "npm run start:assets", | |
source: ".tmp/webpack_output", | |
latency: 1 | |
# ... |
for file in app/views/**/*.html.erb; do html2haml -e $file ${file%erb}haml && rm $file; done