Skip to content

Instantly share code, notes, and snippets.

View RxJava2_AutoDispose2_Binding.kt
package packge.for.you
import android.view.View
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleOwner
import autodispose2.CompletableSubscribeProxy
import autodispose2.FlowableSubscribeProxy
import autodispose2.MaybeSubscribeProxy
import autodispose2.ObservableSubscribeProxy
import autodispose2.ScopeProvider
View Changes.kt
import io.reactivex.Observable
/**
* RxJavaのStreamに流れる一つ前の値と現在の値をひとまとめにするための型
*/
data class Change<T : Any>(
val previous: T?,
val current: T,
)
View zipDelayError.kt
import io.reactivex.Single
import io.reactivex.rxkotlin.Singles
fun <T1 : Any, T2 : Any> Singles.zipDelayError(
s1: Single<T1>,
s2: Single<T2>,
): Single<Pair<T1, T2>> {
abstract class Value(val sortOrder: Int) {
abstract val value: Any
}
@crimsonwoods
crimsonwoods / Android.mk
Last active Feb 14, 2017
Sample makefile for building a shared library using mruby for Android.
View Android.mk
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := mruby
LOCAL_SRC_FILES := /path/to/your/prebuilt/$(TARGET_ARCH_ABI)/libmruby.a
include $(PREBUILT_STATIC_LIBRARY)
include $(CLEAR_VARS)
@crimsonwoods
crimsonwoods / MysteryCodeBroken.swift
Created Feb 3, 2016
Xcode 7.2で謎の現象が起きるコード
View MysteryCodeBroken.swift
//
// このコードをXcode 7.2(7.2.1ではない)でDeployment Targetを7でビルドして、
// iOS7.1.2のデバイスで実行するとfatalErrorが発生する。
//
import UIKit
class Logger {
func put(message: String) {
print(message)
@crimsonwoods
crimsonwoods / kosenconf-100tokyoの交通費等支援の募集要項.md
Last active Dec 21, 2015
Kosenconf-100tokyoの交通費等支援の募集要項
View kosenconf-100tokyoの交通費等支援の募集要項.md

KCFunds ってなに?

高専カンファレンスとお酒が大好きな人達がはじめた個人的なプロジェクトです。KCFundsでは、経済的困難などの問題により、関東での高専カンファレンスに参加できない学生さんを支援します。

更新情報

  • 第一回目の応募を締め切りました。
  • 第二回目の応募も締め切りました。
  • 高専カンファレンス100 in 東京は無事に終了いたしました。
@crimsonwoods
crimsonwoods / build_config.rb
Created Feb 20, 2015
Sample build script for custom mruby based on "1.1.0" (multi-threading supported version)
View build_config.rb
MRuby::Build.new do |conf|
# load specific toolchain settings
# Gets set by the VS command prompts.
if ENV['VisualStudioVersion'] || ENV['VSINSTALLDIR']
toolchain :visualcpp
else
toolchain :gcc
end
@crimsonwoods
crimsonwoods / LGL25_Fx0_config.txt
Created Dec 29, 2014
Kernel configuration for LGL25 named as Fx0
View LGL25_Fx0_config.txt
#
# Automatically generated file; DO NOT EDIT.
# Linux/arm 3.4.0 Kernel Configuration
#
CONFIG_ARM=y
CONFIG_ARM_HAS_SG_CHAIN=y
CONFIG_SYS_SUPPORTS_APM_EMULATION=y
CONFIG_GENERIC_GPIO=y
# CONFIG_ARCH_USES_GETTIMEOFFSET is not set
CONFIG_GENERIC_CLOCKEVENTS=y
@crimsonwoods
crimsonwoods / fib39_mt.rb
Created Apr 19, 2014
perform fib39 concurrently
View fib39_mt.rb
# Fib 39
def fib n
return n if n < 2
fib(n-2) + fib(n-1)
end
t1 = Thread.new do
fib(39)
end
@crimsonwoods
crimsonwoods / thread.c
Created Nov 17, 2013
This is experimental implementation to add thread support into mruby.
View thread.c
#include "mruby.h"
#include "mruby/thread.h"
#include "mruby/variable.h"
#include "mruby/gc.h"
#ifdef ENABLE_THREAD
typedef struct mrb_thread_impl {
mrb_state *mrb;
mrb_gem_thread_t thread;