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
-- ことえり単語登録(== "WordRegister") | |
tell application "WordRegister" | |
activate | |
end tell | |
tell application "System Events" | |
-- 単語の欄にペースト |
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/sh | |
# post-checkout | |
# ============= | |
# arguments | |
# $1: ref of the previous HEAD e.g.) 0000000000000000000000000000000000000000 | |
# $2: ref of the new HEAD e.g.) 959224d097072c8a5640fee31bac7325710eada1 | |
# $3: flag = ブランチをチェックアウトした場合=1, ファイルをチェックアウトした場合=0 | |
# `git clone`時だけ処理をしたいので、通常の`git checkout`時には何もしない | |
if [ "$1" != "0000000000000000000000000000000000000000" -o "$3" != "1" ]; then |
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 'package:rxdart/rxdart.dart'; | |
import 'package:test/test.dart'; | |
void main() { | |
test('ReplaySubjectのサンプル', () { | |
ReplaySubject<int> subject = new ReplaySubject<int>(); | |
// 1, 2をStreamに流す。しかしこの時点ではListenerがいないので配信されない | |
subject.sink.add(1); | |
subject.sink.add(2); |
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 'package:rxdart/rxdart.dart'; | |
import 'package:test/test.dart'; | |
void main() { | |
test('BehaviorSubjectのサンプル', () { | |
BehaviorSubject<int> subject = new BehaviorSubject<int>(); | |
// 1, 2をStreamに流す。しかしこの時点ではListenerがいないので配信されない | |
subject.sink.add(1); | |
subject.sink.add(2); |
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 'package:rxdart/rxdart.dart'; | |
import 'package:test/test.dart'; | |
void main() { | |
test('PublishSubjectのサンプル', () { | |
PublishSubject<int> subject = new PublishSubject<int>(); | |
// 1, 2をStreamに流す。しかしこの時点ではListenerがいないので配信されない | |
subject.sink.add(1); | |
subject.sink.add(2); |
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
クラス名 | リスナー数 | 要素の保存 | |
---|---|---|---|
PublishSubject | リスナーは常にひとりだけ(Single-Subscription) | なし | |
BehaviroSubject | 複数人同時可能(Broadcast) | 最後の1要素のみ保存 | |
ReplaySubject | 複数人同時可能(Broadcast) | (デフォルトでは)全て保存 |
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
Show hidden characters
{ | |
"presets": [ | |
[ | |
"@babel/preset-env", | |
{ | |
"targets": { | |
"node": "6.11.5" | |
} | |
} | |
] |
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/sh | |
# 一時フォルダの場合は特に制限を入れない | |
if [[ $PWD =~ ^/private/var/folders/ ]] ; then | |
exit 0 | |
fi | |
if [ -z "`git config --local user.name`" ]; then | |
echo "\033[31m ✗ FATAL: user.name is not set locally \033[0m" | |
echo "\033[35mgit config user.name {your-name}\033[0m" |
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
{ | |
"Version": "2012-10-17", | |
"Statement": [ | |
{ | |
"Action": "ec2:*", | |
"Effect": "Allow", | |
"Resource": "*" | |
}, | |
{ | |
"Effect": "Deny", |
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
const N = 100; | |
// 裏返しのカードを100枚生成 | |
const cards = Array.from({length: N}, (_unused, index) => { | |
return { is_reversed: true, number: index + 1}; | |
}); | |
// n枚目から、n+1枚ごとにフリップする(n >= 2) | |
for (let i = 1; i < cards.length; i++) { | |
for (let j = i; j < cards.length; j += (i + 1)) { | |
cards[j].is_reversed = !cards[j].is_reversed; |
NewerOlder