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.awt.Color | |
import java.awt.Graphics2D | |
import static java.awt.RenderingHints.* | |
import java.awt.image.BufferedImage | |
import groovy.transform.Immutable | |
@Immutable class Point { double x, y } | |
@Immutable class Trail { Point first, second, third, last } | |
Closure<Point> bearing = { Point start, Point over -> |
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
type FbVal is (U64, (String|None)) | |
type FbNext is (FbActor | None) | |
actor FbActor | |
var _env : Env | |
var _mod : U64 | |
var _word : String | |
var _next : FbNext | |
new create(env: Env, mod: U64, word : String, next: FbNext = None) => |
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
/***** BEGIN LICENSE BLOCK ***** | |
* Version: CPL 1.0/GPL 2.0/LGPL 2.1 | |
* | |
* The contents of this file are subject to the Common Public | |
* License Version 1.0 (the "License"); you may not use this file | |
* except in compliance with the License. You may obtain a copy of | |
* the License at http://www.eclipse.org/legal/cpl-v10.html | |
* | |
* Software distributed under the License is distributed on an "AS | |
* IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or |
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 fizzbuzz; | |
import java.util.Arrays; | |
import java.util.Collection; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.Optional; | |
import java.util.function.Function; | |
import java.util.stream.IntStream; | |
import java.util.stream.Stream; |
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 fizzbuzz; | |
import java.util.Arrays; | |
import java.util.Collection; | |
import java.util.Iterator; | |
import java.util.List; | |
import java.util.function.Function; | |
import java.util.stream.IntStream; | |
import java.util.stream.Stream; |
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
@Grab(group='com.craigburke.document', module='pdf', version='0.3.1') | |
@Grab(group='com.craigburke.document', module='word', version='0.3.1') | |
@Grab('com.bloidonia:ascii-image:1.1') | |
import com.bloidonia.asciiimage.AsciImageProcessor | |
import java.awt.image.BufferedImage | |
import java.awt.RenderingHints | |
import java.awt.Color | |
import javax.imageio.ImageIO | |
import com.craigburke.document.builder.PdfDocumentBuilder |
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
// Requires Groovy 2.4+ and Java 8 | |
@Grab('com.bloidonia:ascii-image:1.1') | |
import com.bloidonia.asciiimage.AsciImageProcessor | |
import java.awt.image.BufferedImage | |
import java.awt.RenderingHints | |
import java.awt.Color | |
AsciImageProcessor.fromLines([ | |
'. . . . . . .', | |
'. . 3 . . . .', |
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.bloidonia.asciiimage | |
import java.awt.* | |
import java.awt.geom.* | |
import java.awt.image.BufferedImage | |
import java.util.List | |
class AsciImage { | |
static enum Type { POINT, PATH, LINE, ELLIPSE } |
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
def matcher = ~/(?<year>\d\d\d\d)-(?<month>\d\d)-(?<day>\d\d)/ | |
switch('2014-10-10') { | |
case matcher: { year, month, day -> | |
println "On day $day of month $month, in the year $year" | |
} | |
} |
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 rx.Observable; | |
import rx.functions.Func4; | |
import rx.subjects.BehaviorSubject; | |
import java.time.Instant; | |
import java.time.temporal.ChronoUnit; | |
import java.time.temporal.TemporalUnit; | |
import java.util.function.Supplier; | |
public class SupplierCircuitBreaker<T> implements Supplier<T> { |