Skip to content

Instantly share code, notes, and snippets.

View rspec
#!/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 = [[], [], []]
View committee_reloader.rb
# @example
# Rails.configuration.middleware.use(
# CommitteeReloader,
# "path/to/schema",
# [
# Committee::Middleware::RequestValidation,
# schema_path: "path/to/schema"
# ]
# )
class CommitteeReloader
View FooPlugin.js
const Watchpack = require("watchpack");
class FooPlugin {
constructor() {
this.started = false;
this.abort = false;
this.aborted = false;
this.files = [];
this.dirs = [];
}
@miyucy
miyucy / mov2gif
Created Nov 15, 2018
movをgifに変換するやつ https://github.com/dergachev/screengif ぽいやつ
View mov2gif
#!/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
View concatenator.rb
class Concatenator
def self.[](*objs)
new(*objs)
end
def initialize(*objs)
@objs = objs
end
def each(&blk)
@miyucy
miyucy / Gemfile
Created Jan 31, 2018
サンプル
View Gemfile
source 'https://rubygems.org'
ruby '2.5.0'
gem 'puma'
gem 'rack'
gem 'sinatra', require: 'sinatra/base'
View README.md
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 Dec 5, 2017
ORCAパッチを手動であてる
View README.md
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
View 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 Jun 19, 2017
JST <=> UTC (GMT)
View timezone.md
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