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 { Iterable } from 'immutable' | |
function checkIsImmutable(obj, path = '') { | |
if (Iterable.isIterable(obj)) { | |
obj.keySeq().forEach(key => { | |
checkIsImmutable(obj.get(key), path + '.' + key); | |
}); | |
} else if (typeof obj === 'object' && obj !== null) { | |
console.warn(path + ' was not immutable'); | |
} else { |
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
package com.tehmou.book.chapter7coffeebreak; | |
import android.support.v4.util.Pair; | |
import android.support.v7.app.AlertDialog; | |
import android.support.v7.app.AppCompatActivity; | |
import android.os.Bundle; | |
import android.widget.TextView; | |
import com.jakewharton.rxbinding.view.RxView; | |
import com.jakewharton.rxbinding.widget.RxTextView; |
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
package com.futurice.project; | |
import java.util.concurrent.TimeUnit; | |
import rx.Observable; | |
import rx.Scheduler; | |
import rx.functions.Func1; | |
public class Solution { |
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
Let's say we have this code that takes a list, makes the items asynchronous observables (i. e. network requests) and then concatenates the results: | |
final List<String> list = Arrays.asList("1", "2", "3", "4", "5", "6"); | |
Log.d(TAG, "start: " + list); | |
Observable.concat( | |
Observable.from(list) | |
.map(s -> { | |
final Subject<String, String> subject = PublishSubject.create(); | |
final int delay = (list.size() - list.indexOf(s)) * 100; |
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
var rasterizeOptions = new RasterizeOptions(); | |
rasterizeOptions.transparency = true; | |
function process (item) { | |
$.writeln(item.name); | |
if (/^rasterize/.exec(item.name)) { | |
app.activeDocument.rasterize(item, null, rasterizeOptions); | |
} else { | |
if (item.layers) { | |
for (var i = 0; i < item.layers.length; i++) { |