Skip to content

Instantly share code, notes, and snippets.

@mgyongyosi
mgyongyosi / List.elm
Created April 1, 2018 21:56
List.pairwise in Elm
module Common.List exposing (pairwise)
import List exposing (drop, head, length, take)
import List.Extra exposing (zip)
import Maybe.Extra exposing (toList)
pairwise : List a -> List ( a, a )
pairwise lst =
let
@mgyongyosi
mgyongyosi / RabbitMQRequeueRouteBuilder.java
Last active September 3, 2017 16:27
camel-rabbitmq requeue example route
package com.mgyongyosi.rabbitmq.test.routes;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.component.rabbitmq.RabbitMQConstants;
import org.springframework.stereotype.Component;
@Component
public class RabbitMQRequeueRouteBuilder extends RouteBuilder {
@Override
@mgyongyosi
mgyongyosi / fileRoute.java
Created May 11, 2017 11:13
Apache Camel stop route when all file processed from the folder
from("file:{{csv.import.directory}}?sendEmptyMessageWhenIdle=true&include=.*.csv").routeId("route1")
.autoStartup(false)
.choice()
.when(body().isEqualTo(null))
.log("Stopping route")
.to("controlbus:route?async=true&routeId=route1&action=stop")
.otherwise()
.log("File with the following name processed: ${header.CamelFileName}")
.end()
;
@mgyongyosi
mgyongyosi / Setup-iTerm-OhMyZsh-Avit.md
Created March 12, 2017 14:54
Setup iTerm2 with Oh my zsh Avit theme

Install iTerm2 with Homebrew

$ brew install cask
$ brew cask install iterm2

Install Oh-my-zsh

Guide: Install Oh My Zsh