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
@Magic | |
@SomeMoreMagic | |
@EvenMoreMagic | |
@AwesomeSauce | |
class Simple | |
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
val x = 100 | |
val y = 1 | |
for (i in 0..x step y) { | |
} | |
val r = 1..100 | |
for (z in r) { | |
println(z) | |
} |
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
# Docker for Jekyll | |
FROM alpine:latest | |
MAINTAINER Hadi Hariri <mail@hadihariri.com> | |
# Install base, Ruby, Headers, Jekyll, Export Path and Clean Up | |
RUN apk update && apk upgrade && apk add curl wget bash && \ | |
apk add ruby ruby-bundler ruby-dev ruby-irb ruby-rdoc libatomic readline readline-dev \ | |
libxml2 libxml2-dev libxslt libxslt-dev zlib-dev zlib \ | |
libffi-dev build-base git nodejs && \ | |
export PATH="/root/.rbenv/bin:$PATH" && \ |
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
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
1. It's a boy's club (by and large) | |
2. The submission process is major pain. 100 fields to fill out | |
3. They want it to be focused entirely around Microsoft products, and giving little attention to other important values of software development. | |
4. They don't cover travel expenses unless you know somebody or fight for it. And covering for some and not all is wrong. | |
5. They want to review your presentation and have the right to modify it if they want. | |
6. It's hardly about development anymore, but IT. | |
and finally, the whole conference is a lot of hype and somewhat arguable formalities. | |
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
fun albumAndTrackLowerThanGivenSeconds_v2(durationInSeconds: Int, albums: List<Album>): List<Pair<String, String>> { | |
return albums.flatMap { | |
val album = it.title | |
it.tracks.filter { | |
it.durationInSeconds <= durationInSeconds | |
}.map { | |
Pair(album, it.title) | |
} | |
} | |
} |
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
fun <T, R, C: MutableCollection<in R>> Iterable<T>.flatMapTo(result: C, transform: (T) -> Iterable<R>) : C |
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
fun <T, R> Iterable<T>.flatMap(transform: (T)-> Iterable<R>) : List<R> |
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
fun albumAndTrackLowerThanGivenSeconds_v1(durationInSeconds: Int, albums: List<Album>): List<Pair<String, String>> { | |
val list = arrayListOf<Pair<String, String>>() | |
albums.forEach { | |
val album = it.title | |
it.tracks.filter { | |
it.durationInSeconds <= durationInSeconds | |
}.map { | |
list.add(Pair(album, it.title)) | |
} |
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
fun nameAndTotalTime_v2(albums: List<Album>): List<Pair<String, Int>> { | |
return albums.map { | |
Pair(it.title, it.tracks.map { it.durationInSeconds }.reduce { x, y -> x +y }) | |
} | |
} |
NewerOlder