Add to build.gradle
apply from:'https://gist.githubusercontent.com/kdabir/0dbf62e16e5af8ef55b43442148f0fe5/raw/depTree.gradle'
And Run
$ gradle tattletaleReport
webpack-dev-server --progress --colors --host $IP --port $PORT |
@GrabConfig(systemClassLoader=true) @Grab('org.hsqldb:hsqldb:2.2.9') import groovy.sql.Sql | |
def sql = Sql.newInstance("jdbc:hsqldb:mem:database", "sa", "", "org.hsqldb.jdbcDriver") | |
println sql.firstRow('VALUES (current_timestamp)') |
def file_path = "C:/path/to/excel/file.xlsx" | |
def read_only = true | |
// Unfortunately this will work only on windows because of this driver :( | |
def connection_url= """jdbc:odbc:Driver={Microsoft Excel Driver (*.xls, *.xlsx, *.xlsm, *.xlsb)}; | |
DBQ=$file_path;READONLY=$read_only""" | |
if (!new File(file_path).exists()) return "invalid file" | |
def sql = groovy.sql.Sql.newInstance(connection_url, '', '') |
var changeHandler = function (e) { | |
console.log ($.trim(this.value)); | |
if ($.trim(this.value)){ | |
$("input[type=submit]").removeAttr("disabled"); | |
} else { | |
$("input[type=submit]").attr("disabled", "disabled"); | |
} | |
}; | |
$("input[type=text]").keyup( |
{ | |
"cmd": ["groovy", "$file"], | |
"selector": "source.groovy", | |
"file_regex": "[ ]*at .+[(](.+):([0-9]+)[)]", | |
"windows": { | |
"shell": "cmd.exe" | |
} | |
} |
@echo off | |
REM set these variables | |
SET HSQLDB_HOME=c:\path\to\hsqldb | |
SET DB_NAME=mydb | |
REM start the server in new window ( prompt visible, so that you can CTRL+C ) | |
REM database files are created in current directory/data | |
start java -cp %HSQLDB_HOME%\lib\hsqldb.jar org.hsqldb.server.Server --database.0 file:data/%DB_NAME% --dbname.0 %DB_NAME% | |
REM start the client GUI and connect to server ( no new cmd window opens because of javaw ) |
import java.text.DecimalFormat; | |
... | |
DecimalFormat df = new DecimalFormat("###,##0.00"); | |
df.format(number); | |
// in the format string, | |
// # -> shows Digit if present else blank | |
// 0 -> shows Digit if present else 0 | |
// details at : http://docs.oracle.com/javase/6/docs/api/java/text/DecimalFormat.html |
map.sort { a,b -> a.value <=> b.value } |
Creating a TimerTask
can not get easier than this thanks to groovy.
import java.util.timer.*
is not required as java.util is already imported.run()
is implemented as closureTo Run this:
groovy https://gist.github.com/kdabir/3176945/raw/timer_example.groovy