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
@echo off | |
for /f %%i in ('gradlew tasks ^| peco') do ( | |
echo gradlew %%i | |
gradlew %%i | |
break | |
) |
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
// something | |
// jenkins | |
import groovy.json.* | |
ext { | |
jenkinsUrl = 'http://localhost:8080' | |
buildNumber = System.getenv("BUILD_NUMBER"); | |
jobName = System.getenv("JOB_NAME"); | |
println "build number is ${buildNumber}" |
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
// ==UserScript== | |
// @name GistViewer | |
// @namespace http://d.hatena.ne.jp/kiy0taka/ | |
// @include * | |
// @exclude http://gist.github.com/* | |
// @exclude http://*.hatena.ne.jp/* | |
// ==/UserScript== | |
(function() { | |
function xpath(query, contextNode) { |
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 groovy.swing.SwingBuilder | |
import griffon.builder.trident.TridentBuilder | |
def trident = new TridentBuilder() | |
def swing = new SwingBuilder() | |
swing.edt { | |
frame( title: "Trident+Groovy", size: [400,200], | |
locationRelativeTo: null, visible: true ) { | |
flowLayout() |
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 groovy.beans.Bindable | |
import groovy.swing.SwingBuilder | |
class Foo { | |
@Bindable Bar bar | |
} | |
class Bar { | |
@Bindable String baz | |
} |
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
# Step.1 | |
http://dist.codehaus.org/grails/grails-bin-1.1.1.zip | |
#Grailsの設定 | |
export GRAILS_HOME=/opt/grails-1.1.1 | |
export PATH=$GRAILS_HOME/bin:$PATH | |
#appengine-javaの設定 http://code.google.com/appengine/downloads.html | |
export APPENGINE_HOME=/opt/appengine-java-sdk-1.3.0 |
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.eclipse.jetty:jetty-server:7.0.1.v20091125') | |
@Grab('org.eclipse.jetty:jetty-servlet:7.0.1.v20091125') | |
import org.eclipse.jetty.server.* | |
import org.eclipse.jetty.server.handler.* | |
import org.eclipse.jetty.servlet.* | |
import groovy.servlet.* | |
server = new Server(8080) | |
servletHandler = new ServletContextHandler(ServletContextHandler.SESSIONS) | |
servletHandler.with { |
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
<?xml version="1.0" ?> | |
<project name="ant-with-groovy" default="test"> | |
<taskdef name="groovy" | |
classname="org.codehaus.groovy.ant.Groovy" | |
classpath="groovy-all-1.7.2.jar" /> <!-- groovy-all-*.jar を指定 --> | |
<target name="test"> | |
<groovy><![CDATA[ | |
// この中にgroovyスクリプトを自由に記述できる。 | |
// このバインディング内で暗黙的に利用可能な変数は以下。 |
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
@echo off | |
:: pecoってディレクトリ移動をするスクリプト. | |
:: | |
:: TODO 文字化けしてた('A`) | |
:init | |
set _pecocd_flags= | |
set _pecocd_folder=%CD% | |
:args | |
if "%1"=="" goto :peco |
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 test(Closure clos) { | |
def localVals = new Object() { | |
def map = [:] | |
def that | |
} | |
clos.delegate = localVals // 参照先を一時変数とする | |
def arg1 = clos.getResolveStrategy() // デフォルトではowner, delegateの順でメソッドやプロパティの存在を確認 | |
localVals.that = 'This is that!' // thatで参照できるようにしてみる。 | |
clos.call(arg1) | |
localVals.map.each { key, value -> |
OlderNewer