Skip to content

Instantly share code, notes, and snippets.

View trautonen's full-sized avatar

Tapio Rautonen trautonen

  • Tampere, Finland
  • 22:23 (UTC +02:00)
View GitHub Profile
@trautonen
trautonen / fish_prompt
Created April 26, 2018 15:00
Terraform workspaces in fish shell
# Edit your fish prompt with `funced fish_prompt` and
# add the following to a desired place in the function.
# Save the prompt after editing with `funcsave fish_prompt`.
# Set a variable for workspace color.
set -l tfworkspace_color (set_color green)
# Append the workspace name at the current prompt position if
# the directory contains a .terraform subdirectory
if test -d .terraform
@trautonen
trautonen / docker-build.sh
Last active March 15, 2021 15:46
New year's Spring Boot tricks in a container
$ mvn clean package docker:build
@trautonen
trautonen / DetourStage.scala
Created October 24, 2015 07:23
Trigger a 'detour' graph from Akka stream
package flows
import akka.actor.ActorRef
import akka.pattern.ask
import akka.stream.ActorMaterializer
import akka.stream.scaladsl.RunnableGraph
import akka.stream.stage._
import akka.util.Timeout
import flows.DetourStage.AwaitCompletion
import scala.io.Source
object OutRunScala {
def solve(source: Source): Int = {
source
.getLines()
.drop(1)
.map(_.trim)
.filterNot(_.isEmpty)
import java.io.BufferedReader;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.regex.Pattern;
import java.util.stream.Collectors;