This file contains hidden or 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 io.mikael.peg; | |
| import java.util.Arrays; | |
| public class Sandbox { | |
| public static void main(String[] args) { | |
| System.out.printf("character('a', 'h').match(\"far\") = <%s>%n", | |
| character('a', 'h').match("far")); |
This file contains hidden or 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 io.mikael.convert; | |
| import java.util.ArrayList; | |
| import java.util.List; | |
| import java.util.function.*; | |
| public class LambdaConverter { | |
| public static class Foo { | |
| public String getA() { return "A"; } |
This file contains hidden or 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
| Document doc = Jsoup.parse(...); | |
| doc.select("form#login").stream() | |
| .map(e -> e.attr("action")) | |
| .map(action -> find(action, LINK_ID_PATTERN).group(1)) | |
| .filter(Objects::nonNull) | |
| .findFirst() | |
| .ifPresent(builder::id); | |
| content.select("div#datePublished").stream() |
This file contains hidden or 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 ruby | |
| require 'parslet' | |
| require 'pp' | |
| require 'awesome_print' | |
| class InspectParser < Parslet::Parser | |
| # TOKENS |
This file contains hidden or 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
| private static <T> boolean fillIf(final Supplier<T> supplier, final Consumer<T> consumer) { | |
| return fillIf(supplier, consumer, null); | |
| } | |
| private static <T> boolean fillIf(final Supplier<? extends T> supplier, final Consumer<T> consumer, final Consumer<Exception> exceptionHandler) { | |
| try { | |
| final T data = supplier.get(); | |
| if (null == data) { | |
| return false; | |
| } |
This file contains hidden or 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
| // gcc check_clock.c -ldl -o check_clock | |
| // ripped from http://hg.openjdk.java.net/jdk8u/jdk8u-gate/hotspot/file/9c2ddd17626e/src/os/linux/vm/os_linux.cpp | |
| #include <dlfcn.h> | |
| #include <stdio.h> | |
| #include <linux/time.h> | |
| typedef int clockid_t; | |
| int main(int argc, const char* argv[]) { |
This file contains hidden or 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
| sudo socat TCP4-LISTEN:80,fork TCP4:localhost:9000 |
This file contains hidden or 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
| Acquire::http::Pipeline-Depth "15"; |
This file contains hidden or 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 com.carrotsearch.junitbenchmarks.BenchmarkOptions; | |
| import com.carrotsearch.junitbenchmarks.BenchmarkRule; | |
| import com.hazelcast.config.Config; | |
| import com.hazelcast.core.Hazelcast; | |
| import com.hazelcast.core.HazelcastInstance; | |
| import org.junit.AfterClass; | |
| import org.junit.BeforeClass; | |
| import org.junit.Rule; | |
| import org.junit.Test; |
This file contains hidden or 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
| # See http://help.ubuntu.com/community/UpgradeNotes for how to upgrade to | |
| # newer versions of the distribution. | |
| deb http://fi.archive.ubuntu.com/ubuntu/ precise main restricted | |
| deb-src http://fi.archive.ubuntu.com/ubuntu/ precise main restricted | |
| ## Major bug fix updates produced after the final release of the | |
| ## distribution. | |
| deb http://fi.archive.ubuntu.com/ubuntu/ precise-updates main restricted | |
| deb-src http://fi.archive.ubuntu.com/ubuntu/ precise-updates main restricted |