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 / Quickly-cd-into-directories-using-fd-and-fzf.md
Last active May 27, 2025 03:04
Quickly cd into directories using fd and fzf

Quickly cd into directories using fd and fzf

Prerequisites

Setup

Just add the following function to your .bashrc or equivalent. Tested on Ubuntu 24.04 with Bash.

@hidakatsuya
hidakatsuya / 2024-12-09-how-the-fixtures-work.md
Last active December 8, 2024 16:29
How Fixtures Load Data in Rails Tests
@hidakatsuya
hidakatsuya / tasks.json
Created April 29, 2024 06:04
Tasks in VSCode for Redmine development using redmined
{
"version": "2.0.0",
"tasks": [
{
"label": "rubocop -aD",
"type": "shell",
"command": "redmined bundle exec rubocop -aD ${relativeFile}",
"presentation": {
"echo": true,
"reveal": "always",
@hidakatsuya
hidakatsuya / getent.md
Created April 14, 2024 09:14
getent - get entries from administrative database, such as passwd and group
getent passwd
root:x:0:0 ...
...
getent passwd root
root:x:0:0 ...
@hidakatsuya
hidakatsuya / accesses-a-url-every-second.sh
Last active April 14, 2024 09:15
A script that accesses a URL every second
url=http://<url>
while true; do TZ=JST-9 date; curl $url; sleep 1s; done
@hidakatsuya
hidakatsuya / localectl.md
Last active March 20, 2024 05:02
Show current settings of the system locale
$ localectl status
   System Locale: LANG=en_US.UTF-8
                  LANGUAGE=en_US:en
       VC Keymap: us
      X11 Layout: us
       X11 Model: pc105
@hidakatsuya
hidakatsuya / bash_aliases
Last active March 17, 2024 13:14
An alias for nvim command to launch nvim with a directory
# Prerequistes
# * OS is Ubuntu 22.04
# * Nvim is installed with AppImage
# Usage
# nvim /path/to/your/project/directory
function nvim() {
path=$1
if [ -d "$path" ]; then
cd $path
@hidakatsuya
hidakatsuya / main.md
Last active January 15, 2024 00:52
Open the GitHub repository for the current branch
@hidakatsuya
hidakatsuya / README.md
Last active November 20, 2023 15:12
Kotlin Flow

Kotlin Flow について

flow.kt

run2() の結果

1+2=3
2+4=6
3+6=9
@hidakatsuya
hidakatsuya / get-absolute-path-of-file.md
Created November 8, 2023 07:24
Get absolute path of file
realpath path/to/file