Skip to content

Instantly share code, notes, and snippets.

View yuta0801's full-sized avatar

yuta yuta0801

View GitHub Profile
@rodeomachine
rodeomachine / twid
Last active March 11, 2021 19:49
twitterユーザーのdata-user-idを表示するブックマークレット(googleキャッシュからの追跡にも使える)
javascript:(function(){var d=document.getElementsByClassName("css-18t94o4 css-1dbjc4n r-1niwhzg r-p1n3y5 r-sdzlij r-1phboty r-rs99b7 r-1w2pmg r-1vuscfd r-1dhvaqw r-1ny4l3l r-1fneopy r-o7ynqc r-6416eg r-lrvibr")[0].getAttribute('data-testid').split('-')[0];window.open('https://idtwi.com/'+d);})()
@uupaa
uupaa / get.path.for.node.js.md
Last active March 7, 2025 14:03
node.js で絶対パスや相対パスを取得する方法 npm __dirname

node.js でパスを取得する方法についてのメモ

$ node ~/hoge/Foo.js/a.js

を実行したときに、

  • process.argv[1] から、node コマンドに指定された a.js のパス( ~/hoge/Foo.js/a.js )を取得できます
@sindresorhus
sindresorhus / post-merge
Last active July 25, 2024 06:53
git hook to run a command after `git pull` if a specified file was changed.In this example it's used to run `npm install` if package.json changed and `bower install` if `bower.json` changed.Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
#!/usr/bin/env bash
# MIT © Sindre Sorhus - sindresorhus.com
# git hook to run a command after `git pull` if a specified file was changed
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`.
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)"
check_run() {
echo "$changed_files" | grep --quiet "$1" && eval "$2"
@hayajo
hayajo / changelog_en.md
Last active April 1, 2025 14:37
ChangeLog を支える英語

ChangeLog を支える英語

ChangeLog を書く際によく使われる英語をまとめました。

ほとんど引用です。

基本形