Skip to content

Instantly share code, notes, and snippets.

@miyucy
miyucy / rspec
Created September 13, 2022 15:16
#!/usr/bin/env ruby
require "bundler/setup"
require "rspec/core"
RSpec::Core::Runner.disable_autorun!
RSpec::Core::Runner.trap_interrupt
options = RSpec::Core::ConfigurationOptions.new(ARGV)
runner = RSpec::Core::Runner.new(options)
runner.setup STDOUT, STDERR
examples = [[], [], []]
# @example
# Rails.configuration.middleware.use(
# CommitteeReloader,
# "path/to/schema",
# [
# Committee::Middleware::RequestValidation,
# schema_path: "path/to/schema"
# ]
# )
class CommitteeReloader
@miyucy
miyucy / FooPlugin.js
Created May 9, 2019 03:22
build cancel
const Watchpack = require("watchpack");
class FooPlugin {
constructor() {
this.started = false;
this.abort = false;
this.aborted = false;
this.files = [];
this.dirs = [];
}
@miyucy
miyucy / mov2gif
Created November 15, 2018 06:58
movをgifに変換するやつ https://github.com/dergachev/screengif ぽいやつ
#!/bin/bash
function func_mov2gif {
local outname
for inname in "${@}"; do
if [ -f "${inname}" ]; then
outname="$(dirname "${inname}")/$(basename -s ".mov" "${inname}").gif"
ffmpeg -i "${inname}" -r 10 -f gif - | gifsicle --threads --optimize --output "${outname}"
fi
done
class Concatenator
def self.[](*objs)
new(*objs)
end
def initialize(*objs)
@objs = objs
end
def each(&blk)
@miyucy
miyucy / Gemfile
Created January 31, 2018 08:57
サンプル
source 'https://rubygems.org'
ruby '2.5.0'
gem 'puma'
gem 'rack'
gem 'sinatra', require: 'sinatra/base'
@miyucy
miyucy / README.md
Last active January 9, 2018 08:24
medimg
mkdir -p data image
ruby download.rb
ruby import.rb

pg_dump --dbname=orca_test --encoding=UTF8 --no-owner --clean --table "tbl_yakujyo" | gzip --best --to-stdout > tbl_yakujyo.sql.gz
pg_dump --dbname=orca_test --encoding=UTF8 --no-owner --clean --table "tbl_med_image" | gzip --best --to-stdout > tbl_med_image.sql.gz

gzcat tbl_yakujyo.sql.gz | psql --host=127.0.0.1 --port=15432 --username=orca --dbname=orca
gzcat tbl_med_image.sql.gz | psql --host=127.0.0.1 --port=15432 --username=orca --dbname=orca
@miyucy
miyucy / README.md
Last active December 5, 2017 06:57
ORCAパッチを手動であてる
sudo -u orca bash program_upgrade_download.sh
vi /var/lib/jma-receipt/patch/patch-file-list
sudo -u orca bash program_upgrade_apply.sh

patch-file-listの中身をいじる

patch500-20170206-1.tar.gz
@miyucy
miyucy / keybase.md
Created July 20, 2017 10:20
keybase.md

Keybase proof

I hereby claim:

  • I am miyucy on github.
  • I am miyucy (https://keybase.io/miyucy) on keybase.
  • I have a public key ASA4n4E8CLGOIM1LwSFZr7EKGUQmKgh4HmOswy0soqZQCgo

To claim this, I am signing this object:

@miyucy
miyucy / timezone.md
Last active June 19, 2017 13:35
JST <=> UTC (GMT)
0900 0000
2016-03-01 00:00:00 +0900 2016-02-29 15:00:00 UTC
2016-03-01 01:00:00 +0900 2016-02-29 16:00:00 UTC
2016-03-01 02:00:00 +0900 2016-02-29 17:00:00 UTC
2016-03-01 03:00:00 +0900 2016-02-29 18:00:00 UTC
2016-03-01 04:00:00 +0900 2016-02-29 19:00:00 UTC
2016-03-01 05:00:00 +0900 2016-02-29 20:00:00 UTC
2016-03-01 06:00:00 +0900 2016-02-29 21:00:00 UTC
2016-03-01 07:00:00 +0900 2016-02-29 22:00:00 UTC