Skip to content

Instantly share code, notes, and snippets.

View yuta0801's full-sized avatar

yuta yuta0801

View GitHub Profile
@hayajo
hayajo / changelog_en.md
Last active July 19, 2024 05:47
ChangeLog を支える英語

ChangeLog を支える英語

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

ほとんど引用です。

基本形

@sindresorhus
sindresorhus / post-merge
Last active May 2, 2024 03:18
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"
@uupaa
uupaa / get.path.for.node.js.md
Last active December 5, 2023 11:18
node.js で絶対パスや相対パスを取得する方法 npm __dirname

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

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

を実行したときに、

  • process.argv[1] から、node コマンドに指定された a.js のパス( ~/hoge/Foo.js/a.js )を取得できます
@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);})()
@PurpleBooth
PurpleBooth / README-Template.md
Last active July 22, 2024 02:29
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

@GabLeRoux
GabLeRoux / .editor
Created September 30, 2015 16:32
Atom split selection into lines (Sublime Text's ctrl+shift+l) From https://discuss.atom.io/t/multiple-selections/755/45
'.platform-win32 .editor, .platform-linux .editor':
'ctrl-shift-L': 'editor:split-selections-into-lines'
'ctrl-shift-up': 'editor:add-selection-above'
'ctrl-shift-down': 'editor:add-selection-below'
@konitter
konitter / eslint-rules.md
Last active September 19, 2017 11:15
ESLintのルール簡単説明と.eslintrc v2.10、フラグ絵文字はeslint:recommended
@rauchg
rauchg / README.md
Last active January 6, 2024 07:19
require-from-twitter
@jarun
jarun / Travis CI local install
Created June 5, 2016 19:00
How to install Travis CI locally on Ubuntu 16.04
sudo apt install ruby ruby-dev
sudo gem install travis
# install path: /var/lib/gems/
@watson
watson / redos.js
Last active December 15, 2022 17:11
Node.js ReDoS example
// for more info about ReDoS, see:
// https://en.wikipedia.org/wiki/ReDoS
var r = /([a-z]+)+$/
var s = 'aaaaaaaaaaaaaaaaaaaaaaaaaaaa!'
console.log('Running regular expression... please wait')
console.time('benchmark')
r.test(s)