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
// ==UserScript== | |
// @name Weekly Shonen Jump Keyboard Shortcuts for Jump plus | |
// @namespace https://shonenjumpplus.com/ | |
// @version 0.1 | |
// @description ジャンプ+で週刊少年ジャンプを読んでるときに便利なショートカットキーを提供する([↓]次の連載 [↑]前の連載 [N]次の号 [P]前の号) | |
// @author me | |
// @match https://shonenjumpplus.com/magazine/* | |
// @grant none | |
// @run-at document-idle | |
// @require https://code.jquery.com/jquery-3.6.0.slim.min.js |
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
@startuml | |
Alice -> Bob : Hello | |
Alice <- Bob : Ignore | |
@enduml |
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 | |
[ | |
{level:1, pmin:10, pmax:13, nmin:1, nmax:6}, | |
{level:2, pmin:12, pmax:15, nmin:1, nmax:7}, | |
{level:3, pmin:15, pmax:18, nmin:1, nmax:7}, | |
{level:4, pmin:18, pmax:20, nmin:1, nmax:7}, | |
{level:5, pmin:20, pmax:22, nmin:1, nmax:7}, | |
{level:6, pmin:20, pmax:23, nmin:1, nmax:8}, | |
{level:7, pmin:23, pmax:25, nmin:1, nmax:8}, |
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
require 'csv' | |
Dir.glob('db/seeds/*.csv') do |file| | |
puts file | |
table_name = file.gsub(/^.*\/([\w\d_]+)\.csv/, '\1') | |
model_class = Module.const_get(table_name.classify) | |
models = CSV.read(file, headers: true).collect{|r| model_class.new(r.to_hash)} | |
update_columns = model_class.accessible_attributes.to_a.reject{|s| s.empty?} | |
model_class.record_timestamps = false if %w(created_at, updated_at).any?{|t| update_columns.include?(t)} |