Skip to content

Instantly share code, notes, and snippets.

View oogatta's full-sized avatar

Naohiro Oogata oogatta

View GitHub Profile
@oogatta
oogatta / index.html
Last active June 3, 2023 11:48
Strange behavior of the IE11 on compat-mode. A function wrapping 'typeof' mis-detect an ActiveXObject.
<!DOCTYPE html>
<html>
<head>
<script src="test.js"></script>
</head>
<body>
</body>
</html>
@oogatta
oogatta / .htmlhintrc
Created September 13, 2016 15:13
sample .htmlhintrc
{
"tagname-lowercase": false,
"tag-pair": true,
"attr-value-double-quotes": true,
"attr-value-not-empty": true,
"attr-no-duplication": true,
"id-unique": true,
"space-tab-mixed-disabled": "space4"
}
@oogatta
oogatta / kotlin-flow-retrying-forever-suspending-functions.kt
Last active September 14, 2020 16:21
kotlin flow retrying forever (suspending functions)
// suspending functions
flow {
emit(doSomethingSuspending())
}.mapNotNull {
if (it == null) {
throw Exception()
}
it
}.retryWhen { _, _ ->
delay(RETRY_INTERVAL)
@oogatta
oogatta / kotlin-flow-retrying-forever-callbacks.kt
Last active September 14, 2020 16:21
kotlin flow retrying forever (callbacks)
// kinds of callbacks
channelFlow {
do.something(object: SomethingListher {
override fun onSomething(something: Something?) {
send(something)
}
})
}.mapNotNull {
if (it == null) {
throw Exception()
{
"title": "oogatta",
"rules": [
{
"description": "右コントロールを単体で押したときに、カーソル上を送信する。",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "right_control",
<span style="color:#f00">test</span>
// ☁️ Admin node
admin.database().ref().child("test").child("Admin")
.orderByChild("hoge") // ソートキー
.endAt(2) // 切り取る範囲
.limitToLast(2) // 切り取る範囲
.on("child_added", snapshot => {
console.log(`(${snapshot.val().hoge}, ${snapshot.val().fuga})`);
});
// 🍎 iOS Swift
// ☁️ Admin node
admin.database().ref().child("test").child("Admin")
.orderByChild("hoge") // ソートキー
.startAt(2) // 切り取る範囲
.limitToFirst(2) // 切り取る範囲
.on("child_added", snapshot => {
console.log(`(${snapshot.val().hoge}, ${snapshot.val().fuga})`);
});
// 🍎 iOS Swift
@oogatta
oogatta / 9.txt
Last active October 3, 2017 12:37
// ☁️ Admin node
admin.database().ref().child("test").child("Admin")
.orderByChild("hoge") // ソートキー
.startAt(2) // 切り取る範囲
.endAt(4) // 切り取る範囲
.on("child_added", snapshot => {
console.log(`(${snapshot.val().hoge}, ${snapshot.val().fuga})`);
});
// 🍎 iOS Swift
// ☁️ Admin node
admin.database().ref().child("test").child("Admin")
.orderByChild("fuga") // ソートキー
.equalTo(4) // 切り取る範囲
.on("child_added", snapshot => {
console.log(`(${snapshot.val().hoge}, ${snapshot.val().fuga})`);
});
// 🍎 iOS Swift
Database.database().reference().child("test").child("iOS")