更新: | 2021-05-23 |
---|---|
作者: | @voluntas |
バージョン: | 2021.1 |
URL: | https://voluntas.github.io/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { useRef } from 'react'; | |
let uniqueId = 0; | |
const getUniqueId = () => uniqueId++; | |
export function useComponentId() { | |
const idRef = useRef(getUniqueId()); | |
return idRef.current; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Cocoa | |
// 標準入力で入力した行全体を取得、スペース区切りにして配列で返す | |
// String型の入力 | |
func stdinStr(array:String?)->[String]{ | |
let str: String = array! | |
let array = str.components(separatedBy:" ")//ここの" "を変更すると区切るワードを変えられる | |
return array | |
} |
例文を組み込んだAlfred Workflowを作りました: Alfred Git Commit Message Example
以下転載:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cat <(printf "\xEF\xBB\xBF") 元のUTF-8ファイル.txt > BOM付きUTF-8ファイル.txt |