Skip to content

Instantly share code, notes, and snippets.

View r7kamura's full-sized avatar

Ryo Nakamura r7kamura

View GitHub Profile
@r7kamura
r7kamura / rename_factories_to_plurals.rb
Last active October 28, 2020 17:06
Rename FactoryBot files from singular to plural.
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'activesupport'
end
require 'active_support/inflector'
require 'pathname'
@r7kamura
r7kamura / space_probe.rb
Last active September 25, 2020 19:13
A Ruby script to print cop names which include "space".
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'activesupport'
gem 'rubocop', '0.84.0'
gem 'rubocop-performance', '1.6.0'
gem 'rubocop-rails', '2.5.2'
module Kernel
alias_method :original_require, :require
def require(path)
time = ::Time.now
original_require(path).tap do
puts "%3.6f\t#{path}" % (Time.now - time)
end
end
end
class MyError < StandardError
def initialize(**options)
p options
end
end
raise MyError, foo: :bar
# frozen_string_literal: true
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'rails', '5.1.7'
end
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'activerecord', '6.0.0'
gem 'sqlite3'
end
require 'active_record'
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'activerecord', '6.0.0'
gem 'sqlite3'
end
require 'active_record'
# frozen_string_literal: true
require 'bundler/inline'
gemfile do
source 'https://rubygems.org'
gem 'rails', '6.0.0'
gem 'sqlite3'
end
/* <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,
digraph G {
graph [
nodesep = 0.5
rankdir = LR
ranksep = 0.8
]
node [
fontsize = 18
shape = polygon