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 / git-cheat-sheet.md
Last active December 31, 2023 09:31
Git Cheat Sheet

特定のコミットが含まれる/含まれないブランチを調べる

git branch --contains <commit>
git branch --no-contains <commit>
git branch -r --contains <commit>
git branch -a --contains <commit>
@hidakatsuya
hidakatsuya / change-owner-of-files-owned-by-root-to-current-user.md
Created January 6, 2023 15:51
Command to change the owner of file owned by root to current user
find . -user root -not -path "./tmp/*" -exec sudo chown $(whoami):$(whoami) {} \
@hidakatsuya
hidakatsuya / Get-status-of-the-check-runs-for-Git-reference.md
Last active December 18, 2022 06:08
Get status of the check-runs for a Git reference

1. Get HEAD reference of main branch

gh api repos/hidakatsuya/shopping_list/branches/main
{
  "name": "main",
  "commit": {
 "sha": "fbc7644c880c0517504e6de6be96e4c3b5c3dda4",
@hidakatsuya
hidakatsuya / gas-cloud-build-executer.js
Last active December 19, 2022 16:43
[GAS] Cloud Build Executer
function init(e) {
const props = PropertiesService.getScriptProperties().getProperties();
if (props.SLACK_VERIFICATION_TOKEN != e.parameter.token) {
throw new Error('Invalid token');
}
const params = parseParams(e.parameter.text);
return { props, params };
@hidakatsuya
hidakatsuya / register-secrets
Last active November 28, 2022 15:57
Script for batch registration to Gcloud Secret Manager
#!/bin/bash
# This script is for the following tutorial procedure.
# https://cloud.google.com/ruby/rails/run?hl=ja#gcloud_5
#
# Setup
#
# gloud auth login
# gloud config set project PROJECT_ID
@hidakatsuya
hidakatsuya / bulk_insertion_of_frozen_string_literal_true.sh
Created June 26, 2022 12:37
Bulk insertion of "# frozen_string_lteral: true" at the beggining of *.rb files
$ find . -type f -name "*.rb" -or -name "Rakefile" -print0 | xargs -0 sed -i "1i# frozen_string_literal: true\n"
@hidakatsuya
hidakatsuya / github-pages-post.md.txt
Last active June 11, 2022 12:50
Fix curly braces in code block are not rendered in jekyll
{% raw %}
```yml
- uses: ruby/setup-ruby@v1
with:
ruby-version: ${{ env.RUBY_VERSION }}
```
{% endraw %}
@hidakatsuya
hidakatsuya / README.md
Last active June 11, 2022 08:20
Caching a docker image to skip pulling an image in GitHub Action
@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