Skip to content

Instantly share code, notes, and snippets.

View mkanenobu's full-sized avatar

Kanenobu Mitsuru mkanenobu

View GitHub Profile
@sorenlouv
sorenlouv / useComponentId.js
Last active June 16, 2023 15:26
React hook for getting a unique identifier for a component
import { useRef } from 'react';
let uniqueId = 0;
const getUniqueId = () => uniqueId++;
export function useComponentId() {
const idRef = useRef(getUniqueId());
return idRef.current;
}
@voluntas
voluntas / loadtest.rst
Last active July 6, 2024 00:34
負荷試験コトハジメ
@ryosism
ryosism / stdin.swift
Last active June 25, 2018 09:05
swiftの標準入力(競技用)
import Cocoa
// 標準入力で入力した行全体を取得、スペース区切りにして配列で返す
// String型の入力
func stdinStr(array:String?)->[String]{
let str: String = array!
let array = str.components(separatedBy:" ")//ここの" "を変更すると区切るワードを変えられる
return array
}
@mono0926
mono0926 / commit_message_example.md
Last active July 20, 2024 08:30
[転載] gitにおけるコミットログ/メッセージ例文集100
@tmr111116
tmr111116 / gist:8282663
Created January 6, 2014 13:09
デフォルトの Mac で UTF-8 の BOM をつけるコマンド
cat <(printf "\xEF\xBB\xBF") 元のUTF-8ファイル.txt > BOM付きUTF-8ファイル.txt