This file contains 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
#!/usr/bin/env ruby | |
require "fileutils" | |
# rubocop:disable Style/MixinUsage | |
include FileUtils | |
# rubocop:enable Style/MixinUsage | |
CONFIG_FILES = %w( | |
config/database.yml | |
config/mail.yml |
This file contains 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
# メール文面向けにプレーンテキストを生成する | |
# | |
# t = TextBuilder.new | |
# | |
# t << "Variables" | |
# t.indent { | |
# t.map(["foo", "bar", "baz"]) {|v| | |
# t << v | |
# } | |
# } |
This file contains 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
#!/usr/bin/env ruby | |
# PS5 版 FF14 にマクロをコピペするための支援スクリプトです。 | |
# 1. PS リモートプレイで操作しマクロ入力欄でキャレットが点滅する状態にする | |
# 2. マクロをクリップボードにコピー | |
# 3. pbpaste | paste-to-ps5 実行 | |
# 4. 通知音がなるたびに△ボタンを押す | |
require "open3" | |
def osascript(script, *args) |
This file contains 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
module StrictAccessor | |
# replace `(Array|Hash)#[]` with `fetch` recursively | |
def self.strictify(o) | |
case o | |
when Array | |
o.map {|e| strictify(e) }.extend(self) | |
when Hash | |
o.each_with_object({}) {|(k, v), h| h[k] = strictify(v) }.extend(self) | |
else | |
o |
This file contains 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
#!/usr/bin/env ruby | |
# | |
# Adding ActiveJob job without activejob gem example. | |
# For job class like: | |
# class FooJob < ApplicationJob | |
# queue_as :foo | |
# | |
# def perform(a, b) | |
# puts a, b | |
# end |
This file contains 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
RSpec::Matchers.define :a_valid_argument do | |
match {|actual| block_arg.call(actual) } | |
end |
This file contains 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
module By | |
def by(user) | |
case user | |
when String, Symbol | |
user = send(user) | |
when NilClass | |
return | |
end | |
sign_in user |
This file contains 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
Show hidden characters
{ | |
"compilerOptions": { | |
"noImplicitAny": true, | |
"module": "es6", | |
"target": "es5", | |
"jsx": "react", | |
"allowJs": true, | |
"moduleResolution": "node", | |
// import Foo from "foo" を書けるようにする | |
"allowSyntheticDefaultImports": true, |
This file contains 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
extends: | |
- eslint:all | |
- plugin:@typescript-eslint/all | |
- plugin:vue/recommended | |
env: | |
browser: true | |
parser: "vue-eslint-parser" | |
parserOptions: | |
extraFileExtensions: | |
- vue |
NewerOlder