This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ENV['RAILS_ENV'] ||= 'test' | |
| require_relative '../config/environment' | |
| require 'rails/test_help' | |
| # DO NOT FORGET THIS. | |
| OmniAuth.config.test_mode = true | |
| class ActiveSupport::TestCase | |
| # ...some code here |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| rails new app_name --webpack=react |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| app | price | bandwidth | |
|---|---|---|---|
| one | two | 33 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # frozen_string_literal: true | |
| class AuthController < ActionController::API | |
| before_action :allow_cors | |
| protected | |
| def allow_cors | |
| response.headers['Access-Control-Allow-Origin'] = request.headers['Origin'] || '*' | |
| response.headers['Access-Control-Allow-Credentials'] = 'true' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main; | |
| import com.fazecast.jSerialComm.SerialPort; | |
| public class Starter { | |
| public static void main(String[] args) { | |
| System.out.println("Hello world"); | |
| SerialPort[] ports = SerialPort.getCommPorts(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { environment } = require('@rails/webpacker') | |
| const { CleanWebpackPlugin } = require("clean-webpack-plugin"); | |
| environment.plugins.prepend("CleanWebpackPlugin", new CleanWebpackPlugin()); | |
| // default config from https://webpack.js.org/plugins/split-chunks-plugin/#optimizationsplitchunks | |
| environment.splitChunks((config) => | |
| Object.assign({}, config, { | |
| optimization: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const { environment } = require('@rails/webpacker') | |
| const { CleanWebpackPlugin } = require("clean-webpack-plugin"); | |
| environment.plugins.prepend("CleanWebpackPlugin", new CleanWebpackPlugin()); | |
| // default config from https://webpack.js.org/plugins/split-chunks-plugin/#optimizationsplitchunks | |
| environment.splitChunks((config) => | |
| Object.assign({}, config, { | |
| optimization: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div id="reactappv1"></div> | |
| <%= javascript_packs_with_chunks_tag 'spa/app' %> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| yarn add compression-webpack-plugin --save | |
| OR | |
| npm install compression-webpack-plugin --save |