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
data class Customer(val name: String, val email: String) | |
if you want to have mutable properties | |
data class Customer(var name: String, var email: String) |
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
// Without it | |
ObservableHttp.createRequest(HttpAsyncMethods.createGet(url), client) | |
.toObservable() | |
.flatMap({ response -> response.getContent().map { | |
byte -> | |
String(byte) | |
} | |
}) | |
.toBlocking() | |
.forEach { |
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
return ObservableHttp.createRequest(HttpAsyncMethods.createGet(url), client) | |
.toObservable() | |
.flatMap({ response -> response.getContent().map { | |
byte -> | |
String(byte) | |
} | |
}) | |
.toBlocking() | |
.forEach { | |
data -> println(data) |
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.somanyfeeds.application | |
import javax.servlet.annotation.WebServlet | |
import javax.servlet.http.* | |
import java.io.InputStream | |
import java.io.BufferedReader | |
import java.io.Writer | |
import java.io.InputStreamReader | |
WebServlet(name = "SoManyFeeds", value = array("/*")) |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>org.test</groupId> | |
<artifactId>demo</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<packaging>jar</packaging> |
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 javax.servlet.http.HttpServlet | |
import javax.servlet.http.HttpServletRequest | |
import javax.servlet.http.HttpServletResponse | |
import javax.servlet.annotation.WebServlet as web | |
import javax.inject.Inject | |
import javax.enterprise.context.Dependent | |
web(name = "Hello", value = array("/hello")) | |
public class HomeController : HttpServlet() { |
NewerOlder