Skip to content

Instantly share code, notes, and snippets.

View hidakatsuya's full-sized avatar
🏡
Working from home

Katsuya HIDAKA hidakatsuya

🏡
Working from home
View GitHub Profile
@hidakatsuya
hidakatsuya / README.md
Last active February 28, 2022 15:40
Script for migrating Vue2 components to Compotision API

Script for migrating Vue2 components to CompositionAPI

https://github.com/thinreports/thinreports-section-editor の Vue2 形式のコンポーネントを CompositionAPI に一括で変換するための Ruby スクリプト。

⚠️Warning

あくまで https://github.com/thinreports/thinreports-section-editor のコンポーネントの移行のための使い捨てのスクリプト。 元のコードのインデント規則やコードスタイルなど、一定の前提の下で動作するものであり、汎用性は一切考慮していない。

Prerequisites

@hidakatsuya
hidakatsuya / output-structure-of-spec.md
Last active February 17, 2022 05:28
RSpec の spec の構造のみ出力するコマンド

RSpec の spec ファイルの構造のみ出力する

git grep -h -E "([^\._](describe|context|it) '.+' do|it_behaves_like .*$)" -- spec/path/to/*_spec.rb

Output:

describe 'a' do
  it 'aa' do
describe 'b' do
@hidakatsuya
hidakatsuya / time-zone-of-date-time-on-sql-in-rails.md
Last active January 23, 2022 06:06
Time zone of date and time on SQL in Rails

これは?

Rails におけるSQL上の日付時刻のタイムゾーンがどのように扱われるかの調査結果

環境

  • Ruby 2.7
  • Rails 6.1
  • MySQL5
@hidakatsuya
hidakatsuya / main.css
Created May 5, 2021 07:20
A HTML dialog to convert an image to base64 format
:root {
--canvas-padding: 10px;
}
body {
margin: 0;
padding: var(--canvas-padding);
}
.inner {
@hidakatsuya
hidakatsuya / screen-cheat-sheet.md
Last active November 3, 2023 11:59
GNU screen Cheat Sheet

Escape Key

C+t (default C+a)

Window

  • C+t c 新しい window を作る
  • C+t " window リストを表示する
  • C+t C+t 一つ前の window に切り替える
  • C+t n 次の window へ切り替える
@hidakatsuya
hidakatsuya / Example.md
Last active October 8, 2020 16:09
Simple and Cusomizable Dotfile Management #dotfile

Introduction

This example is my actual dotfile environment.

I have two working environments, macOS and ubuntu. The dotfiles in these environments are slightly different, so each dotfile is separated.

Directory Structure

$HOME/dotfiles
@hidakatsuya
hidakatsuya / command.sh
Last active June 10, 2020 09:50
One-liner for bulk file renaming
for a in path/to/**/prefix_*.rb ; do dir=`dirname $a`; mv $a "${dir}/new_filename.rb"; done
@hidakatsuya
hidakatsuya / thinreports
Created January 20, 2019 07:24
New Object Structure of thinreports-generator
item/
style/
base.rb
basic.rb
graphic.rb
text.rb
text_formatter/ (text_block/formatter/*)
basic.rb
datetime.rb
number.rb
@hidakatsuya
hidakatsuya / list_line_height.rb
Last active November 25, 2018 17:04
List line-height each font with prawn
require 'prawn'
fonts = [
['Helvetica', 'Agj'],
['Courier', 'Agj'],
['Times-Roman', 'Agj'],
['fonts/ipag.ttf', 'Agjぽ'],
['fonts/ipagp.ttf', 'Agjぽ']
]
$ docker system df
$ docker system prune (only <none>)
$ docker system prune -a
$ docker volume prune (-a)