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
#!/bin/bash | |
# もし現在のgitブランチ(ここでfooとします。)がpushされていれば、{remote_name}/fooを返します。 | |
# そうでなければこのブランチのルートとなるブランチ(分岐元)を取得し、それを返します。 | |
# | |
# このプログラムはまず、リモート名を取得します。 | |
# remoteが複数登録されている場合の適切な処理は未定義です。 | |
# 現在は1番目のリモートを使用するようになっています。 | |
# Returns tags and branches names of the root revision of 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
#!/bin/bash | |
# もし現在のgitブランチ(ここでfooとします。)がpushされていれば、{remote_name}/fooを返します。 | |
# そうでなければこのブランチのルートとなるブランチ(分岐元)を取得し、それを返します。 | |
# | |
# このプログラムはまず、リモート名を取得します。 | |
# remoteが複数登録されている場合の適切な処理は未定義です。 | |
# 現在は1番目のリモートを使用するようになっています。 | |
# Returns tags and branches names of the root revision of 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
# Created by https://www.toptal.com/developers/gitignore/api/unity | |
# Edit at https://www.toptal.com/developers/gitignore?templates=unity | |
### Unity ### | |
# This .gitignore file should be placed at the root of your Unity project directory | |
# | |
# Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore | |
#/[Ll]ibrary/ | |
/[Tt]emp/ |
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
#!/bin/bash | |
root_dir=$(git rev-parse --show-toplevel) | |
remote_latest_branch=$(bash -c "$root_dir/scripts/get-root-branch.sh") | |
current_branch=$(git branch --show-current) | |
unpushed_files=$(git diff --stat "$remote_latest_branch..$current_branch" --name-only) | |
# Example usage: textlint for markdown | |
unpushed_markdown_files=$(echo "$unpushed_files" | grep '\.md$') |
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
interface Foo { | |
x: number | string | |
} | |
interface Bar { | |
x: number | |
} | |
function main(): void { | |
const foo: Foo = {x: 10} |
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
/** | |
* Exposes type utility functions. | |
* @packageDocumentation | |
*/ | |
/** | |
* Does `x` have an undefined property `prop`, | |
* or that property is `PropType`? | |
* | |
* @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
/** | |
* Exposes type utility functions. | |
* @packageDocumentation | |
*/ | |
/** | |
* Does `x` have an undefined property `prop`, | |
* or that property is `PropType`? | |
*/ | |
export function haveUndefienedPropertyOrThat< |
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
function hasUndefienedPropertyOrThat< | |
PropType, | |
Prop extends string, | |
Base extends { [P in Prop]?: PropType } | |
>(p: (x: PropType | undefined) => x is PropType, x: Base, prop: Prop): boolean { | |
return x[prop] === undefined || p(x[prop]); | |
} |
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
// not nullish | |
function f(): number { | |
return 10 | |
} | |
const x = f() ?? 20 // but ?? can use | |
console.log(x) |
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
image: node:10.15.0 | |
pipelines: | |
branches: | |
default: | |
- step: | |
name: Sanity check | |
caches: | |
- node | |
script: |