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
plugins { | |
id 'base' | |
} | |
ext { | |
current = new Date().format('yyyy-MM-dd-HH-mm-ss') | |
} | |
task randomFiles { | |
group = 'Create Files' |
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
IntRange.metaClass.define { | |
random = { | |
return new Random().nextInt(delegate.size()) + delegate.min() | |
} | |
} | |
class Dices { | |
protected List dices = [(1..6), (1..6), (1..6)] | |
public def play = { |
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 servlet = [ | |
doPost : {req, res -> | |
println 'hello servlet' | |
} | |
] as javax.servlet.http.HttpServlet | |
def req = [ | |
getProtocol : {'HTTP/1.1'} | |
] as javax.servlet.http.HttpServletRequest |
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
apply plugin: 'groovy' | |
apply plugin: 'idea' | |
sourceCompatibility = 1.8 | |
version = '1.0' | |
group = 'hoge.piyo' | |
repositories { | |
mavenCentral() | |
} |
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
trait One { | |
int one () {1} | |
} | |
trait Two { | |
int two () {2} | |
} | |
class Num implements One {} | |
def num = new Num() as Two |
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 shibuya.lt; | |
import org.junit.Ignore; | |
import org.junit.Rule; | |
import org.junit.Test; | |
import org.junit.experimental.categories.Category; | |
import org.junit.rules.TestName; | |
import shibuya.categories.NormalTests; | |
import shibuya.categories.SlowTests; |
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('org.codehaus.groovy.modules.remote:remote-core:0.5') | |
@Grab('org.codehaus.groovy.modules.remote:remote-transport-http:0.5') | |
import com.sun.net.httpserver.HttpServer | |
import groovyx.remote.transport.http.RemoteControlHttpHandler | |
import groovyx.remote.server.Receiver | |
def receiver = new Receiver() |
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 spring.boot.learning; | |
import org.springframework.boot.SpringApplication; | |
import org.springframework.boot.autoconfigure.EnableAutoConfiguration; | |
import org.springframework.web.bind.annotation.RequestMapping; | |
import org.springframework.web.bind.annotation.RestController; | |
/** | |
* Copyright 2014Shinya Mochida | |
* <p/> |
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 groovyx.net.http.* | |
def http = new HTTPBuilder('http://localhost:8080/api/bookmarks/2') | |
http.request(Method.DELETE) { | |
response.success = {resp -> println 'ok'} | |
response.failure = {resp -> println 'ng'} | |
} |
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
spring: | |
datasource: | |
driverClassName: org.apache.derby.jdbc.EmbeddedDriver | |
url: jdbc:derby:/Users/mike/IdeaProjects/spring-boot/self/learning/database.db;create=true | |
username: sa | |
password: sa | |
jpa: | |
hibernate: | |
ddl-auto: update |
OlderNewer