Skip to content

Instantly share code, notes, and snippets.

View kellyrob99's full-sized avatar

Kelly Robinson kellyrob99

View GitHub Profile
@mkutz
mkutz / Jenkinsfile
Last active June 8, 2021 17:21
Configure global libraries in Jenkins (see https://jenkins.io/doc/book/pipeline/shared-libraries/) using a post-initialization script (see https://wiki.jenkins.io/display/JENKINS/Post-initialization+script)
@Library("my-other-jenkins-lib@other-version") _
pipeline {
agent any
environment {
SECRET_TEXT = credentials("googleChatWebhookCommonSystemTestsStatus")
}
import groovy.json.JsonSlurper
import org.sonatype.nexus.repository.storage.Asset
import org.sonatype.nexus.repository.storage.StorageFacet
def DOCKER_REPOSITORY_NAME = 'docker-hosted'
def dockerRepository = repository.repositoryManager.get(DOCKER_REPOSITORY_NAME)
def dockerBlobStore = blobStore.blobStoreManager.get(dockerRepository.configuration.attributes.storage.blobStoreName)
def storageTx = dockerRepository.facet(StorageFacet.class).txSupplier().get()
try {
@rgl
rgl / nexus-provision.groovy
Last active June 16, 2023 18:59
provision nexus users that can push or deploy to any repository (e.g. NuGet or Maven)
// see https://books.sonatype.com/nexus-book/3.0/reference/scripting.html
// see https://github.com/sonatype/nexus-book-examples/tree/nexus-3.0.x/scripting/nexus-script-example
import groovy.json.JsonOutput
import org.sonatype.nexus.security.user.UserSearchCriteria
import org.sonatype.nexus.security.authc.apikey.ApiKeyStore
import org.sonatype.nexus.security.realm.RealmManager
import org.apache.shiro.subject.SimplePrincipalCollection
import org.sonatype.nexus.scheduling.TaskScheduler
import org.sonatype.nexus.scheduling.schedule.Daily
@jpotts
jpotts / example.sh
Created November 13, 2014 15:39
Need a better approach to sorting semantic version strings in Elasticsearch
# Delete the example index
curl -XDELETE "http://localhost:9200/sortable-version-test?pretty=true"
# Create a new example index
curl -X POST "http://localhost:9200/sortable-version-test?pretty=true"
# Set the mapping. Assumes version.groovy resides in $ES_HOME/config/scripts
curl -XPOST "http://localhost:9200/sortable-version-test/version/_mapping?pretty=true" -d'
{
"version": {
anonymous
anonymous / gradle-dependency-analyze.gradle
Created December 19, 2012 04:46
A simple Gradle wrapper for the maven dependency:analyze goal
import org.apache.maven.shared.dependency.analyzer.ClassAnalyzer
import org.apache.maven.shared.dependency.analyzer.DefaultClassAnalyzer
import org.apache.maven.shared.dependency.analyzer.DependencyAnalyzer
import org.apache.maven.shared.dependency.analyzer.ProjectDependencyAnalysis
import org.apache.maven.shared.dependency.analyzer.asm.ASMDependencyAnalyzer
import org.gradle.api.Project
import org.gradle.api.artifacts.ConfigurationContainer
import org.gradle.api.artifacts.ResolvedArtifact
import org.gradle.api.artifacts.ResolvedDependency
@agnoster
agnoster / README.md
Last active April 6, 2024 22:35
My ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

@djangofan
djangofan / gist:2939268
Created June 15, 2012 23:56
Groovy script to watch a directory for changes in JDK1.7
import java.io.File;
import java.io.IOException;
import java.net.URI;
import java.net.URISyntaxException;
import java.nio.file.*;
// requires JDK 1.7.0+
Path tmpPath = Paths.get( args[0])
WatchService watchService = FileSystems.getDefault().newWatchService()
@SQiShER
SQiShER / UpdateEnvironmentPlist.sh
Created May 17, 2012 16:46
Two simple commands to resolve problems with Maven installed via Homebrew
defaults write ~/.MacOSX/environment.plist M2_HOME `brew --prefix maven`/libexec
defaults write ~/.MacOSX/environment.plist M2 `brew --prefix maven`/libexec/bin
@glaforge
glaforge / build.gradle
Created November 25, 2011 16:04 — forked from Dierk/build.gradle
build.gradle for setting up a new gradle-based project
apply plugin:'groovy'
apply plugin:'idea'
repositories { mavenCentral() }
dependencies {
groovy 'org.codehaus.groovy:groovy-all:1.8.4'
}
task makeDirs(description:'make all dirs for project setup') << {
@shemnon
shemnon / gist:856936
Created March 6, 2011 01:44
Add the idea plugin to every single build script
# add to ~/.gradle/initscript.gradle
addListener(new ArtifactoryGradleSettings())
class ArtifactoryGradleSettings extends BuildAdapter implements BuildListener {
def void projectsLoaded(Gradle gradle) {
Project root = gradle.getRootProject()
root.allprojects {
apply plugin: 'idea'
}