This file contains hidden or 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
| #!/usr/bin/env groovy | |
| import java.util.zip.ZipFile | |
| def printelnerr = System.err.&println | |
| def appName = this.getClass().getName() | |
| def cli = new CliBuilder( usage:"${appName} --basedir <path_to_dir> --intersectdir <path_to_dir> " ) | |
| cli.with { |
This file contains hidden or 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
| # Defaults / Configuration options for homebridge | |
| # The following settings tells homebridge where to find the config.json file and where to persist the data (i.e. pairing and others) | |
| HOMEBRIDGE_OPTS=-U /var/lib/homebridge | |
| # If you uncomment the following line, homebridge will log more | |
| # You can display this via systemd's journalctl: journalctl -f -u homebridge | |
| # DEBUG=* |
This file contains hidden or 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
| #!/usr/bin/env groovy | |
| def year = 2018 | |
| Calendar.metaClass.yearMonthDay { | |
| delegate.format("yyyy-MM-dd") | |
| } | |
| Calendar.metaClass.weekDay { | |
| delegate.format("EEEE") |
This file contains hidden or 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
| #!/usr/bin/env groovy | |
| import java.nio.charset.StandardCharsets | |
| import org.apache.commons.cli.Option | |
| def cli = new CliBuilder( usage:"${this.getClass().getName()} --u <username> -p <password>" ) | |
| cli.with { | |
| u( longOpt: 'user', 'username', args: 1, required: true ) | |
| p( longOpt: 'password', 'password', args: 1, required: true ) |
This file contains hidden or 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
| #!/usr/bin/env groovy | |
| import java.nio.charset.StandardCharsets | |
| String text = "" | |
| if ( this.args.size() > 0 ) { | |
| text = this.args[0] | |
| } | |
| else { |
This file contains hidden or 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
| #! /usr/bin/env groovy | |
| class LatLng{ | |
| /* | |
| Latitude is written before longitude. Latitude/Longitude is written with a decimal number. | |
| Latitude is decimal number rangeing from positive to negative (north and south of the Equator) | |
| Longitude is decimal number rangeing from positive to negative (negative is west of Greenwich and positive is eastward of Greenwich) | |
| Latitude is the Y axis, Longitude is the X axis. | |
| */ |
This file contains hidden or 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
| #!/usr/bin/env groovy | |
| import groovy.xml.XmlUtil | |
| import javax.net.ssl.SSLSession | |
| import javax.net.ssl.HostnameVerifier | |
| import javax.net.ssl.SSLContext | |
| import javax.net.ssl.HttpsURLConnection | |
| import static javax.net.ssl.HttpsURLConnection.HTTP_OK |
This file contains hidden or 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
| #!/usr/bin/env groovy | |
| @Grab(group='com.googlecode.gbench', module='gbench', version='0.4.2-groovy-2.3') | |
| import groovyx.gbench.BenchmarkBuilder | |
| def charGen = { String alphabet, int n -> | |
| new Random().with { | |
| (1..n).collect { alphabet[ nextInt( alphabet.length() ) ] }.join() |
This file contains hidden or 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
| #! /usr/bin/env groovy | |
| //@GrabConfig(systemClassLoader=true) | |
| @Grab(group='ch.qos.logback', module='logback-classic', version='1.2.3') | |
| @Grab(group='org.apache.pdfbox', module='pdfbox', version='2.0.11') | |
| @Grab(group='commons-io', module='commons-io', version='2.6') | |
| import org.apache.pdfbox.pdfwriter.* | |
| import org.apache.pdfbox.pdmodel.* | |
| import org.apache.pdfbox.pdmodel.font.* |
This file contains hidden or 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
| #!/usr/bin/env osascript -l JavaScript | |
| function run( argv ) { | |
| '…Your cxode here…' | |
| } |