Skip to content

Instantly share code, notes, and snippets.

View dvdsmpsn's full-sized avatar

David Simpson dvdsmpsn

View GitHub Profile
@dvdsmpsn
dvdsmpsn / gist:5863690
Last active July 3, 2020 03:15
Tips for installing Oracle Java on a headless VM

Installing Oracle Java on a headless VM

Oracle requires you to login and accept a license agreement before downloading the JDK. This is tiresome especially if your VM has no display. This is a workaround for the tiresomeness.

In a browser on the host machine

  1. Browse to http://www.oracle.com/technetwork/java/javase/downloads/index.html or go to the archive page for an older version
  2. Select the correct version of Java
  3. Accept License Agreement
  4. Login to Oracle - the setup file starts to download
@dvdsmpsn
dvdsmpsn / bookmarklet.6music.js
Last active July 10, 2018 13:17
Bookmarklets for browsers
// Opens a small Radio 6 Music window just like the "Listen Live" link here -- https://www.bbc.co.uk/6music
// To "compile", URL encode everything after "javascript:"
// using http://meyerweb.com/eric/tools/dencoder/
// Source:
javascript:(function(){
window.open('https://www.bbc.co.uk/radio/play/live:bbc_6music', 'player6music', 'menubar=no,location=no,resizable=no,scrollbars=no,status=no,width=380,height=685');
})();
@dvdsmpsn
dvdsmpsn / mvn
Created July 31, 2013 15:59
Maven with Notification Centre support - It's a work in progress.
#!/bin/bash
#
# USAGE: atlas-mvn <parameters and goals>
#
# Invoke maven with the supplied parameters and goals.
#
# When the build is complete, send a message to notification centre indicating if the build was successful, and
# the directory in which it was run (in case there are multiple builds running concurrently). If you invoked this
# script from either Terminal or iTerm2, clicking the notification should take you back to it.
#
@dvdsmpsn
dvdsmpsn / open-links-in-new-window.vm
Created September 11, 2013 11:03
Confluence User Macro: Open links in new window
@dvdsmpsn
dvdsmpsn / check-build-number.vm
Last active December 23, 2015 04:18
Atlassian Confluence: Format HTML based on version/build number
## Velocity has access to `$generalUtil` in Confluence
## @see: https://developer.atlassian.com/display/CONFDEV/Confluence+Objects+Accessible+From+Velocity
##
## `$generalUtil.getBuildNumber()` returns the build number
## @see: https://developer.atlassian.com/display/CONFDEV/Confluence+Build+Information
## $generalUtil.getBuildNumber() returns a String, so convert to int
#set($confluenceBuildNumber = 0)
@dvdsmpsn
dvdsmpsn / aui-button.usermacro.vm
Last active May 23, 2018 23:19
AUI Button - Confluence user macro
## aui-button
##
## Macro title: AUI Button
## Macro has a body: N
## Output: HTML
##
## Developed by: David Simpson <david@appfusions.com>
## Date created: 2013-09-18
## Installed by: Your Name
@dvdsmpsn
dvdsmpsn / aui-button-container.usermacro.vm
Last active December 23, 2015 08:19
AUI Button Container - Confluence user macro
## aui-button-container (wrapper)
##
## Macro title: AUI Button Container
## Macro has a body: Y
## Output: HTML
##
## Developed by: David Simpson <david@appfusions.com>
## Date created: 2013-09-18
## Installed by: Your Name
##
@dvdsmpsn
dvdsmpsn / addon-custom-events.js
Last active December 23, 2015 22:39
Adding custom JavaScript events to your add-ons in Atlassian products
// This approach allows you to decouple code much better. The event and the event handler can be completely separated.
// See also: http://mattryall.net/blog/2010/05/improving-javascript-code-with-custom-events
// event handling function
var someCustomBehaviour = function () {
AJS.log(' +++ event triggered: my-custom-event');
}
...
...
// bind the event to some function
// yes, a comment
console.log('hello, this is an example gist.');
@dvdsmpsn
dvdsmpsn / gist:6734127
Last active December 24, 2015 02:59
What is this madness? It's a Mac, but I have a directory called C:\m2repo
david$ atlas-run
...
... Downloading the internet here (as maven does)
...
david$ ls -la
total 24
drwxr-xr-x 9 david staff 306 27 Sep 20:32 .
drwxr-xr-x 7 david staff 238 27 Sep 19:36 ..
drwxr-xr-x 11 david staff 374 27 Sep 20:37 .idea