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 / 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 / gradle-cheat-sheet.md
Last active November 3, 2023 11:58
Gradle Cheat Sheet
@hidakatsuya
hidakatsuya / ruby-run-e-httpd.md
Created May 17, 2023 13:55
ruby -run -e httpd
$ gem i webrick
$ ruby -run -e httpd -- --port 8000 .
[2023-05-17 22:52:46] INFO  WEBrick 1.8.1
[2023-05-17 22:52:46] INFO  ruby 3.2.1 (2023-02-08) [x86_64-linux]
[2023-05-17 22:52:46] INFO  WEBrick::HTTPServer#start: pid=70048 port=8000
[2023-05-17 22:52:46] INFO  To access this server, open this URL in a browser:
[2023-05-17 22:52:46] INFO http://127.0.0.1:8000
@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 / 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 / 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 / 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 %}