Skip to content

Instantly share code, notes, and snippets.

View dedickinson's full-sized avatar
💭
not much

Duncan Dickinson dedickinson

💭
not much
  • Personal Use
  • Brisbane
View GitHub Profile
@dedickinson
dedickinson / console.sh
Created March 4, 2020 00:08
Exploring Git
git version
# git version 2.20.1
# Setup the Git user config
git config --global --add user.name "Fred Nurk"
git config --global --add user.email "fred.nurk@example.com"
mkdir git-test
cd git-test
git init
@dedickinson
dedickinson / Set-ARMSub.ps1
Created July 31, 2018 22:15
Azure - PowerShell - Change Subscription
Connect-AzureRmAccount
$subs = Get-AzureRmSubscription
$subs
Set-AzureRmContext -SubscriptionObject $subs[1]
@dedickinson
dedickinson / GitHubLicense.groovy
Last active August 6, 2016 06:19
Demonstrates use of the GitHub API lib to get license details
@Grab('org.kohsuke:github-api:1.77')
import org.kohsuke.github.*
import org.apache.commons.io.IOUtils
GitHub github = GitHub.connect()
PagedIterable<GHLicense> licenses = github.listLicenses()
println 'Known licenses:'
@dedickinson
dedickinson / javaCodeHtml
Created March 23, 2016 00:29
Extracts a Java source file from a Jar and presents a basic HTML page. Requires a copy of highlight.js
import groovy.xml.StreamingMarkupBuilder
import java.util.jar.JarFile
import static java.util.zip.ZipFile.OPEN_READ
JarFile sources = new JarFile(new File('tika-parsers-1.12-sources.jar'), true, OPEN_READ)
sources.getInputStream(sources.getEntry('org/apache/tika/parser/audio/AudioParser.java')).withReader { reader ->
def builder = new StreamingMarkupBuilder()
@dedickinson
dedickinson / BetamaxSpecTest.groovy
Created March 21, 2016 01:39
A sample Spock test using Betamax - fails on SSL call
@Grab('org.spockframework:spock-core:1.0-groovy-2.4')
@Grab('software.betamax:betamax-junit:2.0.0-alpha-1')
@Grab('org.glassfish.jersey.core:jersey-client:2.22.1')
import org.junit.Rule
import software.betamax.ProxyConfiguration
import software.betamax.TapeMode
import software.betamax.junit.Betamax
import software.betamax.junit.RecorderRule
import spock.lang.Specification
@dedickinson
dedickinson / reconfig.gradle
Created September 18, 2015 05:39
Some Gradle reconfig
project.with {
//See: https://docs.gradle.org/current/dsl/org.gradle.api.reporting.ReportingExtension.html
reporting {
baseDir "$publishDirPath/reports"
}
//Used by the groovydoc task
docsDirName = "$publishDirPath/api"
distsDirName = "${publishDirPath}/dist"
@dedickinson
dedickinson / intellij_username
Created June 28, 2015 03:41
Override the username in IntelliJ templates
(For OS X)
See: https://www.jetbrains.com/idea/help/tuning-intellij-idea.html
> mkdir ~/Library/Preferences/IntelliJ\ IDEA\ 14\ CE/
> cp /Applications/IntelliJ\ IDEA\ 14\ CE.app/Contents/bin/idea.vmoptions ~/Library/Preferences/IntelliJ\ IDEA\ 14\ CE/
> vi ~/Library/Preferences/IntelliJ\ IDEA\ 14\ CE/idea.vmoptions
Add the line below:
-Duser.name=Duncan Dickinson
#! /bin/bash
# Ensure that you are running JDK 7 and Maven 2.2.1
mkdir arms
cd arms
git clone https://github.com/qcif/redbox-rdsi.git src
cd src
mvn clean install
@dedickinson
dedickinson / Build ARMS
Created October 15, 2013 23:28
Script for building the ARMS system
#! /bin/bash
# Ensure that you are running JDK 7 and Maven 2.2.1
mkdir arms
cd arms
git clone https://github.com/qcif/redbox-rdsi.git src
cd src
mvn clean package -Pbuild-package
@dedickinson
dedickinson / ARMS Install
Created October 15, 2013 22:52
Provides a document script for installing the ARMS System
#! /bin/bash
# Stage 1: install required packages
sudo apt-get install openjdk-7-jre