Skip to content

Instantly share code, notes, and snippets.

View Dispader's full-sized avatar
:electron:
Present Company Excluded, LLC

Jake Gage Dispader

:electron:
Present Company Excluded, LLC
View GitHub Profile
:grab 'com.github.groovy-wslite:groovy-wslite:1.1.3'
client = new SOAPClient('http://www.holidaywebservice.com/Holidays/US/Dates/USHolidayDates.asmx')
import wslite.soap.SOAPClient
// RESULT: wslite.soap.SOAPClient
client = new SOAPClient('http://www.holidaywebservice.com/Holidays/US/Dates/USHolidayDates.asmx')
// RESULT: wslite.soap.SOAPClient@2baa8d82
response = client.send(SOAPAction: 'http://www.27seconds.com/Holidays/US/Dates/GetMothersDay') {
body {
GetMothersDay('xmlns':'http://www.27seconds.com/Holidays/US/Dates/') { year(2016) }
}
@Grab( 'com.github.groovy-wslite:groovy-wslite:0.8.0' )
import wslite.soap.*
import wslite.http.auth.*
import groovy.xml.XmlUtil
def client = new SOAPClient( 'https://test.anis.ch/HTDB.WebService/AnimalImportService.asmx' )
client.authorization = new HTTPBasicAuthorization( "613731", "test" )
// Trust the ssl for this site
@Dispader
Dispader / slack-test.groovy
Created May 9, 2016 23:51
groovysh Slack API test for Extemporaneous Groovy
groovy:000> base = 'https://slack.com/api/'
===> https://slack.com/api/
groovy:000> "${base}api.test?token=${token}".toURL().text
===> {"ok":true,"args":{"token":"xoxp-29736524550-29773811473-41484563842-0e0ceb60c8"}}
groovy:000>
@Dispader
Dispader / selenium-driver.md
Created April 30, 2016 10:44
a simple `groovysh` session, driving a Firefox browser with WebDriver
groovy:000> import org.openqa.selenium.*
===> org.openqa.selenium.firefox.*, org.openqa.selenium.*
groovy:000> import org.openqa.selenium.firefox.*
===> org.openqa.selenium.*, org.openqa.selenium.firefox.*
groovy:000> driver = new FirefoxDriver() as WebDriver
===> FirefoxDriver: firefox on MAC (1b117b7b-c930-f642-8273-206cb455eedb)
groovy:000> driver.get('http://google.com')
===> null
groovy:000> searchBox = driver.findElement(By.id('lst-ib'))
@Dispader
Dispader / jarinator
Last active April 21, 2016 05:50
a small utility to download JAR files from Maven Central, first revision
#!/usr/bin/env groovy
if ( args.size() < 1 ) {
scriptFile = getClass().protectionDomain.codeSource.location.path.split('/').last()
System.out.println("usage: ${scriptFile} [dependency]+*")
System.exit(0)
}
args.each {
println "downloading ${it}"
new Dependency(it)?.download()
@Dispader
Dispader / it_will_be_fine.md
Last active April 18, 2016 22:19
First draft notes for "It Will Be Fine."

It Will Be Fine

motivation

first pass

The purpose here is to see if we can flesh out 50 minutes of a MinneBar session to improve the lives of both Devs and Ops, not quite comfortable with Git tree manipulation.

Come to think of it— whatever we decide to do with MinneBar11 this year— this talk could help folk. Let's do make a project of fleshing it.

@Dispader
Dispader / extemporaneous_java.md
Last active April 15, 2016 21:11
talk outline

Extemporaneous Coding

motivation

  • flow
  • low barrier to investigation
  • prototype -> project

irb

@Dispader
Dispader / osx.md
Last active April 13, 2016 04:10
Running notes on configuring OSX.

How to OSX

"Buy this vaccuum." —The Kids in the Hall

System Preferences: input

  1. open Keyboard preferences: command-space, keyb, enter
  2. Keyboard tab 1. slide Key Repeat to Fast
  3. slide Delay Until Repeat to Short
@Dispader
Dispader / irb_completion.md
Created April 11, 2016 19:50
How does it take me ten years to find this kind of thing?
irb(main):012:0> require 'irb/completion'
=> true
@Dispader
Dispader / test.sh
Created April 7, 2016 23:04
example Scripts-to-Rule-Them-All example, passing arguments to Gradle, allowing subset test running
#!/bin/bash
set -e
cd "$(dirname "$0")/.."
export JEE_ENV=development
./gradlew test integrationTest $@