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
#!/bin/bash | |
## hacked for https://github.com/AdoptOpenJDK/jdk9-jigsaw/blob/master/09_JLink/link.sh | |
set -eu | |
echo "Removing any existing executable directory" | |
rm -rf executable |
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 demo | |
import io.vertx.core.Vertx | |
import io.vertx.core.http.HttpServer | |
import io.vertx.core.http.HttpServerResponse | |
import io.vertx.ext.web.Route | |
import io.vertx.ext.web.Router | |
import io.vertx.ext.web.RoutingContext | |
fun Router.get(path: String, handler: (RoutingContext) -> Unit): Route { |
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
scala> :paste | |
// Entering paste mode (ctrl-D to finish) | |
def listToMap[T](list: List[T])(init : Map[T,T] = Map[T,T]()): Map[T,T] = list match { | |
case Nil => init | |
case a :: Nil => init | |
case a :: b :: rest => listToMap(rest)( init + (a -> b)) | |
} | |
// Exiting paste mode, now interpreting. |
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
module Option where | |
type Option a = None | Some a | |
getOrElse : Option a -> a -> a | |
getOrElse o e = | |
case o of | |
None -> e | |
Some a -> a |
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 java.util.Arrays; | |
import java.util.List; | |
import java.util.stream.Collectors; | |
import java.util.concurrent.TimeUnit; | |
public class Main { | |
public static void main(String[] args) { | |
time(() -> { | |
List<String> strs = Arrays.asList("hello", "world", "google"); |
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
defmodule A do | |
def tap_when(target, c, f) do | |
if c do | |
IO.puts "yes" | |
f.(target) | |
else | |
IO.puts "no" | |
target | |
end | |
end |
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
#!/usr/bin/env crystal | |
puts "hello, world" |
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
macro new_instance(clazz, args) | |
{{clazz.id}}.new({{*args}}) | |
end | |
module Util | |
class A | |
getter msg | |
def initialize(@msg) |
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
class Object | |
def hello | |
puts "hello" | |
end | |
def to (&block) | |
yield self if self | |
end | |
end |
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
ret = | |
File.stream!("GeoID.csv") | |
|> CSV.decode(separator: ?,) | |
|> Enum.map(fn row -> row |> Enum.map &String.upcase/1 end) | |
ret | |
|> tl | |
|> Enum.each fn row -> | |
{t1, t2, t3, t4, t5, t6, _} = List.to_tuple row | |
IO.puts t5 |