Skip to content

Commit 8610ee8

Browse files
committed
added some examples
later these should be moved to the actual project repos
1 parent d99bd82 commit 8610ee8

File tree

7 files changed

+36
-0
lines changed

7 files changed

+36
-0
lines changed

embed-test.markdown

+9
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,12 @@ id: embedding
1414
<tab-code label="Kotlin" language="" url=""></tab-code>
1515
<tab-code label="JRuby" language="" url=""></tab-code>
1616
</tabs-panel>
17+
18+
<tabs-panel flex>
19+
<tab-code label="Java" language="java" url="https://api.github.com/repos/GeorgiKhomeriki/RxCourse/contents/HeadTail.java"></tab-code>
20+
<tab-code label="Scala" language="scala" url="https://api.github.com/repos/GeorgiKhomeriki/RxCourse/contents/Gui.java"></tab-code>
21+
<tab-code label="Groovy" language="groovy" url="https://api.github.com/repos/GeorgiKhomeriki/RxCourse/contents/Flatmap.java"></tab-code>
22+
<tab-code label="Clojure" language="scala" url="https://api.github.com/repos/GeorgiKhomeriki/RxCourse/contents/Game.java"></tab-code>
23+
<tab-code label="Kotlin" language="" url=""></tab-code>
24+
<tab-code label="JRuby" language="" url=""></tab-code>
25+
</tabs-panel>

examples/clojure/hello.clj

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
(defn hello
2+
[&rest]
3+
(-> (Observable/from &rest)
4+
(.subscribe #(println (str "Hello " % "!")))))

examples/clojure/hello.output

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
(hello ["Ben" "George"])
2+
Hello Ben!
3+
Hello George!

examples/groovy/hello.groovy

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
def hello(String[] names) {
2+
Observable.from(names)
3+
.subscribe({ println "Hello " + it + "!" })
4+
}

examples/groovy/hello.output

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
hello("Ben", "George")
2+
Hello Ben!
3+
Hello George!

examples/java/hello.java

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
public static void hello(String... names) {
2+
Observable.from(names).subscribe(new Action1<String>() {
3+
4+
@Override
5+
public void call(String s) {
6+
System.out.println("Hello " + s + "!");
7+
}
8+
9+
});
10+
}

examples/java/hello.output

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
hello("Ben", "George");
2+
Hello Ben!
3+
Hello George!

0 commit comments

Comments
 (0)