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
export PATH="/usr/local/sbin:$PATH" | |
export PATH=$PATH:$M2_HOME/bin | |
export GROOVY_HOME=/usr/local/opt/groovy/libexec | |
export GOPATH="${HOME}/.go:${HOME}/devmap/go" | |
export PATH="$PATH:${GOPATH}/bin" | |
function setjdk() { |
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
#!/usr/bin/env groovy | |
// Java 9 or later (…for the TIFF ImageIO Plugin) | |
@Grab(group='ch.qos.logback', module='logback-classic', version='1.2.3') | |
@Grab(group='org.apache.pdfbox', module='pdfbox', version='2.0.15') | |
@Grab(group='commons-io', module='commons-io', version='2.6') | |
import org.apache.pdfbox.pdfwriter.* | |
import org.apache.pdfbox.pdmodel.* |
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
#!/usr/bin/env groovy | |
package myapp | |
@Grab('org.springframework:spring-context:5.1.6.RELEASE') | |
@Grab('org.springframework:spring-web:5.1.6.RELEASE') | |
@Grab('org.springframework.boot:spring-boot:2.1.4.RELEASE') | |
@Grab('org.springframework.boot:spring-boot-starter:2.1.4.RELEASE') | |
@Grab('org.springframework.boot:spring-boot-starter-webflux:2.1.4.RELEASE') |
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
#!/usr/bin/env groovy | |
import static groovy.json.JsonOutput.prettyPrint | |
println prettyPrint( new URL ("http://fw.ota.homesmart.ikea.net/feed/version_info.json").getText() ) | |
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
#!/usr/bin/env groovy | |
Boolean TRUE = true | |
Boolean FALSE = false | |
println "Boolean true => string: '${Boolean.toString(TRUE)}'" | |
println "Boolean false => string: '${Boolean.toString(FALSE)}'" | |
println "String 'true' => string: '${Boolean.parseBoolean("true")}'" | |
println "String 'TRUE' => string: '${Boolean.parseBoolean("TRUE")}'" |
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
#!/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 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
// Array of [UInt8] to hex String extension | |
// let arr = [0x03, 0x00, 0x02, 0x05, 0x11, 0x25, 0xa0, 0xfe, 0xe5] as [UInt8] | |
// let hex = arr.hexValueString (hex is the result) | |
extension Collection where Element == UInt8 { | |
var hexValueString: String { | |
return map{ String(format: "0x%02x", $0) }.joined(separator: ", ") | |
} | |
} |
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
#!/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 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
Numbers = Application('Numbers'); | |
Numbers.includeStandardAdditions = true | |
var table = Numbers.documents[0].sheets[0].tables[0] | |
var selectedRow = table.selectionRange().cells[0]; | |
var hoursCellRow = selectedRow.row().address(); | |
var weekEndingCell = table.ranges["B" + hoursCellRow + ":B" + hoursCellRow].cells[0]; | |
var nameCell = table.ranges["C" + hoursCellRow + ":C" + hoursCellRow].cells[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
//debugger; | |
'use strict'; | |
var mailboxName = 'your.email@here.com' | |
var mail = new Application("Mail") | |
var account = mail.accounts.whose({ name: { _contains: mailboxName } }, {ignoring: 'case'}) | |
var mailbox = account.mailboxes.whose({ name: { _contains: 'INBOX' } }, {ignoring: 'case'}) | |
// var messages = mail.selection(); |