Skip to content

Instantly share code, notes, and snippets.

Avatar

Ryo Nakamura r7kamura

View GitHub Profile
View raise_kwargs_test.rb
class MyError < StandardError
def initialize(**options)
p options
end
end
raise MyError, foo: :bar
View test_rails_format_accept.rb
# frozen_string_literal: true
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'rails', '5.1.7'
end
View active_record_nested_dependents.rb
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'activerecord', '6.0.0'
gem 'sqlite3'
end
require 'active_record'
View active_record_time_default.rb
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'activerecord', '6.0.0'
gem 'sqlite3'
end
require 'active_record'
View active_storage_test.rb
# frozen_string_literal: true
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'rails', '6.0.0'
gem 'sqlite3'
end
View r7kamura-hatenablog-com.css
/* <system section="theme" selected="life"> */
@import url("/css/theme/life/life.css");
/* </system> */
body {
color: rgba(0, 0, 0, 0.8);
line-height: 1.7;
}
h1,
View dota-auto-chess-items-graph.dot
digraph G {
graph [
nodesep = 0.5
rankdir = LR
ranksep = 0.8
]
node [
fontsize = 18
shape = polygon
View activerecord-6-0-0-beta1-habtm-validation.rb
require "bundler/inline"
gemfile(true) do
source "https://rubygems.org"
gem "activerecord", "6.0.0.beta1", require: "active_record"
gem "sqlite3"
end
ActiveRecord::Base.logger = Logger.new(STDOUT)
@r7kamura
r7kamura / README.md
Last active Feb 19, 2020
Migration from Sprockets to Webpack
View README.md

Directory structure

Before

.
|-- app/
|   `-- assets/
|       |-- fonts/
|       |-- images/
View Dockerfile
FROM ruby:2.5.1
WORKDIR /app
RUN gem install bundler -v 2.0.1
COPY \
Gemfile \
Gemfile.lock \
/app/
You can’t perform that action at this time.