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
task someTask << { | |
println 'A task that will fail' | |
throw new RuntimeException() | |
} | |
task cleanup << { | |
println 'Will perform cleanup no matter what' | |
} | |
someTask.finalizedBy cleanup |
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
webpack-dev-server --progress --colors --host $IP --port $PORT |
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 now = new A() | |
class A{ | |
def getCurrentDate() {new Date().format("yyyy-MM-dd HH:mm:ss")} | |
def call(){ getCurrentDate() } | |
} | |
now() | |
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
sqr = (n) -> n*n | |
sqrt = (n) -> Math.sqrt n | |
hypt = (h,w) -> sqrt (sqr(h) + sqr(w)) | |
console.log hypt(10, 6.5) | |
console.log hypt(10, 6) | |
console.log hypt(6, 9) | |
console.log hypt(6, 9) |
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
test { | |
testLogging { | |
events "failed" | |
exceptionFormat "short" | |
} | |
} |
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
find . -type d -name .git ! -path "*/node_modules/*" ! -path "*/bower_components/*" |
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
class A | |
constructor: (@a)-> | |
if @a>0 then @child = new A(@a-1) | |
console.log new A(2) |
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('io.github.kdabir.directree:directree:0.3.0') | |
import static directree.DirTree.build | |
def d = build("test"){ | |
dir "mydir", { | |
} | |
} | |
assert d.mydir.file == new File("test/mydir") |
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
groovy -ne 'println line.split(/\./)[-1]' | |
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
sleep = (ms) -> | |
new Promise (resolve, reject) -> | |
try | |
setTimeout(resolve, ms) | |
catch e | |
reject(e) | |
return | |
sleep(1000).then( -> console.log "hola" ) |