Skip to content

Instantly share code, notes, and snippets.

@ClickerMonkey
ClickerMonkey / types.ts
Last active February 6, 2024 07:21
Typescript Helper Types
// when T is any|unknown, Y is returned, otherwise N
type IsAnyUnknown<T, Y, N> = unknown extends T ? Y : N;
// when T is never, Y is returned, otherwise N
type IsNever<T, Y = true, N = false> = [T] extends [never] ? Y : N;
// when T is a tuple, Y is returned, otherwise N
// valid tuples = [string], [string, boolean],
// invalid tuples = [], string[], (string | number)[]
@kenmori
kenmori / TypeScriptPractice.md
Last active May 7, 2024 08:28
TypeScript 練習問題集
@sgdan
sgdan / dockerignore-test.sh
Created May 11, 2019 23:58
Test the ".dockerignore" file to ensure the build context doesn't contain unwanted files
#!/bin/sh
# Based on BMitch's answer from:
# https://stackoverflow.com/questions/38946683/how-to-test-dockerignore-file
# Note: will create and delete temporary file "Dockerfile.build-context"
# 1. Copy to project folder where image is being built
# 2. Run script
# 3. You should see list of files in build context
@mono0926
mono0926 / commit_message_example.md
Last active May 10, 2024 09:02
[転載] gitにおけるコミットログ/メッセージ例文集100
@sudodo
sudodo / how_to_get_cleared_stash_on_git
Created December 9, 2011 06:24
git stash clearを元に戻す方法
h1. 変更が消えてしまった!?その対応
せっかく実施したコードへの修正が消えてしまう、これほど開発者をがっかりさせることは無いでしょう。
Gitを使えば、消えてしまったように見える変更を復活できることがあります。
h2. 大原則
復活できる可能性があるのは、「何らかの形でGitに履歴を残してある歴史」だけです。
たとえば、以下のファイルを復活させることはできません。