Skip to content

Instantly share code, notes, and snippets.

View rodolfodpk's full-sized avatar
🏠
Working from home

rodolfodpk rodolfodpk

🏠
Working from home
View GitHub Profile
;;; based on the discussion at https://groups.google.com/d/msg/netty/mcGswAZ5NeQ/ivG9snRSFy4J
(ns netty4.core
(:import [io.netty.bootstrap AbstractBootstrap ServerBootstrap]
[io.netty.channel ChannelFuture ChannelInitializer ChannelOption
ChannelHandlerContext ChannelInboundHandlerAdapter ChannelHandler]
[io.netty.handler.logging LogLevel LoggingHandler]
io.netty.buffer.ByteBuf
io.netty.channel.socket.SocketChannel
io.netty.channel.nio.NioEventLoopGroup
// lib to add: http://code.google.com/p/google-gson/downloads/detail?name=google-gson-2.2.2-release.zip&can=2&q=
// file Main.scala
package demo
import scala.collection.JavaConverters._
import com.google.gson.Gson
import java.util.ArrayList
import java.lang.reflect.Type
import com.google.gson.reflect.TypeToken

Kotlin + Guiceやってみた

これは Kotlin Advent Calendar の26……じゃなくて13日目です!

経緯

がんばって読んでください。読まなくても良いですけど。

/*
* Copyright (C) 2013 Square, Inc.
*
* Licensed under the Apache License, Version 2.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.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
apply plugin: "osgi"
apply plugin: "java"
apply plugin: "maven"
version = "0.0.1"
buildscript {
repositories {
mavenCentral()
}
@rodolfodpk
rodolfodpk / execOnChange.sh
Created September 4, 2012 17:13 — forked from derekwyatt/execOnChange.sh
Executes an arbitrary command when files change.
#!/bin/bash
command="$1"
shift
fileSpec="$@"
sentinel=/tmp/t.$$
touch -t197001010000 $sentinel
while :
do
@rodolfodpk
rodolfodpk / CQRS_ES_Actor.scala
Created August 27, 2012 03:31 — forked from viktorklang/CQRS_ES_Actor.scala
CQRS and EventSourcing using Akka Actors
import scala.collection.mutable.ListBuffer
import akka.actor.{Actor,ActorRef}
import akka.actor.Actor._
import akka.routing.{ Listeners, Listen }
//Represents a domain event
trait Event
//A builder to create domain entities
trait EntityBuilder[Entity] {