Skip to content

Instantly share code, notes, and snippets.

@sheehan
sheehan / script.groovy
Last active January 8, 2018 15:49
Run this script in the Jenkins console to get the all the plugin dependencies for use with the Job DSL and Jenkins Test Harness..
Jenkins.instance.pluginManager.activePlugins.sort { it.shortName }.each { plugin ->
def manifest = plugin.manifest
String groupId = manifest.mainAttributes.getValue('Group-Id')
String artifactId = manifest.mainAttributes.getValue('Extension-Name')
String version = manifest.mainAttributes.getValue('Implementation-Version')
if (groupId && artifactId && version) {
println "testPlugins '$groupId:$artifactId:$version'"
}
}
### Keybase proof
I hereby claim:
* I am sheehan on github.
* I am sheehan (https://keybase.io/sheehan) on keybase.
* I have a public key whose fingerprint is 0645 9E9D E535 CF66 8238 D1CF D7B8 BAE1 D70A 310F
To claim this, I am signing this object:
@sheehan
sheehan / a.groovy
Last active August 29, 2015 14:05
testing
job {
name 'test'
}
node_version=0.10.26
node_name=node-v${node_version}-linux-x64
node_dir=~/jenkins/node
mkdir -p $node_dir
test -f ${node_dir}/${node_name}.tar.gz || wget -P $node_dir http://nodejs.org/dist/v${node_version}/${node_name}.tar.gz
test -f ${node_dir}/${node_name}/bin/node || tar -zxvf ${node_dir}/${node_name}.tar.gz -C $node_dir
export PATH=${node_dir}/${node_name}/bin:$PATH
@sheehan
sheehan / backbone.marionette.stackregion.coffee
Last active July 13, 2023 08:37
Region that uses a view stack. Only the top view is visible. Useful if you want to add layers onto a region and allow the user to navigate back through them.
class Backbone.Marionette.StackRegion extends Backbone.Marionette.Region
constructor: ->
super
@views = []
# Return the top view (currently visible)
peek: ->
@views[@views.length - 1] if @views.length
package org.grails.plugin.handlebars
import org.mozilla.javascript.Scriptable
import org.mozilla.javascript.Function
import org.mozilla.javascript.Context
import org.mozilla.javascript.tools.shell.Global
class Precompiler {
private Scriptable scope
modules = {
core {
defaultBundle 'core'
dependsOn 'jquery, handlebars_runtime'
resource url: '/js/app/core/loader.coffee', bundle: 'core'
resource url: '/js/app/core/main.coffee', bundle: 'core'
resource url: '/css/app/core/mixins.less'
resource url: '/css/app/core/layout.less'
resource url: '/css/app/dummy.css'
@sheehan
sheehan / timing.js
Created December 3, 2012 18:58
Usage of Navigation Timing API
var events = ['navigationStart',
'unloadEventStart',
'unloadEventEnd',
'redirectStart',
'redirectEnd',
'fetchStart',
'domainLookupStart',
'domainLookupEnd',
'connectStart',
'connectEnd',
import org.codehaus.groovy.grails.commons.ConfigurationHolder
import org.codehaus.groovy.grails.web.servlet.mvc.GrailsWebRequest
import grails.util.Environment
import org.grails.plugins.settings.Setting
class JsonFilters {
def securityService
def filters = {