Skip to content

Instantly share code, notes, and snippets.

View mllrjb's full-sized avatar

Jason Miller mllrjb

View GitHub Profile
@mllrjb
mllrjb / README.md
Last active February 14, 2019 14:15
Jenkins init.groovy.d LDAP Authentication

Usage

Set LDAP_BIND_USER and LDAP_BIND_PASSWORD environment variables in the system (e.g. when creating your Docker container, etc).

@mllrjb
mllrjb / jdk-installers.groovy
Last active July 4, 2020 10:42
Jenkins init.groovy.d JDK Installer
import jenkins.model.*
import hudson.model.*
import hudson.tools.*
def inst = Jenkins.getInstance()
def desc = inst.getDescriptor("hudson.model.JDK")
def versions = [
"jdk8": "jdk-8u102-oth-JPR"
@mllrjb
mllrjb / ant-installers.groovy
Created October 12, 2016 21:12
Jenkins init.groovy.d Ant Installer
import jenkins.model.*
import hudson.model.*
import hudson.tasks.*
import hudson.tools.*
def inst = Jenkins.getInstance()
def desc = inst.getDescriptor("hudson.tasks.Ant")
def versions = [
angular.injector(['ng', 'ngSanitize']).get('$sanitize')('asdf<script>FooBar</script>')
function htmlEncode(value){
//create a in-memory div, set it's inner text(which jQuery automatically encodes)
//then grab the encoded contents back out. The div never exists on the page.
return $('<div/>').text(value).html();
}
function htmlDecode(value){
return $('<div/>').html(value).text();
}
@mllrjb
mllrjb / ngName
Last active December 23, 2015 11:19
Angular directive to support expressions in `input.name`, pending merge of https://github.com/angular/angular.js/pull/3135.
.directive('ngName', function() {
return {
restrict: 'A',
require: ['^form', 'ngModel'],
link: function($scope, ele, attr, ctrl) {
var formCtrl = ctrl[0];
var ngModel = ctrl[1];
var name = $scope.$eval(attr.mppName);
if (ngModel.$name != name) {
formCtrl.$removeControl(ngModel);