Skip to content

Instantly share code, notes, and snippets.

View ryohey's full-sized avatar
👶

ryohey ryohey

👶
View GitHub Profile
import 'dart:async';
final stream = StreamController<int>();
void main() async {
stream.stream.listen((d) {
print(d);
}, onError:(e){
print(e);
}, cancelOnError: true);
@ryohey
ryohey / subsumption_architecture.md
Last active October 9, 2020 23:33
機械翻訳: How to Build Complete Creatures Rather than Isolated Cognitive Simulators

https://people.csail.mit.edu/brooks/papers/how-to-build.pdf

孤立した認知シミュレーターではなく完全な生き物を構築する方法

ロドニーA.ブルックス マサチューセッツ工科大学、人工知能研究所

前書き

どのようにして、私たちと同じ世界に生息する人工生物を構築できますか?私にとって、これは常に人工知能のロマンスでした。

@ryohey
ryohey / detach.js
Last active March 11, 2021 21:16
Detach and flatten all frames in Figma
const detachAndFlatten = (pageName) => {
const detach = (c) => figma.union([c], c.parent)
const page = figma.root.children.find(c => c.name === pageName)
const frames = page.children.filter(c => c.type === "FRAME")
for (let frame of frames) {
for (let c of frame.children) {
if (c.type === "INSTANCE") {
c = detach(c)
} else {
@ryohey
ryohey / LazyReactiveProperty.cs
Created December 11, 2019 04:12
値を変更しても即座に変わらない ReactiveProperty
using System;
using UniRx;
namespace WMN
{
// 値を変更しても即座に変わらない ReactiveProperty
public class LazyReactiveProperty<T> : ReactiveProperty<T>
{
/*
* 値が変更されようとしたときに呼ばれる。
@ryohey
ryohey / DictionaryKeyReactiveProperty.cs
Created December 11, 2019 04:11
ReactiveDictionary の特定の key だけを監視する IReactiveProperty を作る
using System;
using UniRx;
namespace WMN
{
// ReactiveDictionary の特定の key だけを監視する IReactiveProperty を作る
public class DictionaryKeyReactiveProperty<T, K, V> : IReactiveProperty<T> where T: V
{
private ReactiveDictionary<K, V> dict;
private K key;
@ryohey
ryohey / ReactiveRoomProperties.cs
Last active December 11, 2019 04:10
Photon の Room の Custom Properties を UniRx の ReactiveDictionary に変換するクラス
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Photon.Pun;
using UniRx;
namespace WMN
{
// Room の Custom Properties を ReactiveDictionary に変換するクラス
@ryohey
ryohey / ObservablePropertyWrapper.cs
Created December 11, 2019 04:07
任意の IObservable を IReactiveProperty として扱えるようにするクラス
using System;
using System.Collections.Generic;
using UniRx;
namespace WMN
{
// 任意の IObservable を IReadOnlyReactiveProperty として扱えるようにするクラス
public class ReadOnlyObservablePropertyWrapper<T> : IReadOnlyReactiveProperty<T>
{
private readonly IObservable<T> source;
#!/usr/local/bin/fish
git checkout-index -a -f --prefix="git-export/";
mv git-export ~/Desktop/(basename (pwd));
@ryohey
ryohey / main.js
Created November 4, 2018 00:18
convert kanko_all.csv to json
const csv = require("csv")
const fs = require("fs")
const _ = require("lodash")
console.log("start processing")
csv.parse(fs.readFileSync("./kanko_all.csv"), (error, data) => {
if (error) {
console.error(error)
return
@ryohey
ryohey / swiftgen.md
Created March 19, 2018 12:30
Swift Code Generators