Skip to content

Instantly share code, notes, and snippets.

Avatar
🏁

Wes Higbee g0t4

🏁
View GitHub Profile
View solitaire-pipeline-starting-point.groovy
stage 'CI'
node {
git branch: 'jenkins2-course',
url: 'https://github.com/g0t4/solitaire-systemjs-course'
// pull dependencies from npm
// on windows use: bat 'npm install'
sh 'npm install'
@g0t4
g0t4 / links.md
Last active May 10, 2021
Starting Point Files for Jenkins2 Getting Started course
View links.md
@g0t4
g0t4 / config.xml
Created Jul 24, 2016
Module 2 - What am I? Get this job loaded into Jenkins and running, there are two problems you'll encounter. Raw
View config.xml
<?xml version='1.0' encoding='UTF-8'?>
<project>
<actions/>
<description></description>
<keepDependencies>false</keepDependencies>
<properties/>
<scm class="hudson.plugins.git.GitSCM" plugin="git@2.5.2">
<configVersion>2</configVersion>
<userRemoteConfigs>
<hudson.plugins.git.UserRemoteConfig>
@g0t4
g0t4 / glossary.md
Last active Jun 7, 2021
Consul and related terms
View glossary.md
  • Node - a physical or virtual machine that hosts services
    • Nodes also referred to as members.
    • Examples
      • Your computer
      • An AWS EC2 instance
      • A bare metal machine in your private data center
  • Service - executing software that provides utility via an interface
    • Typically long-lived process listening on a port(s)
    • Examples
  • A web server (nginx, apache, iis)
@g0t4
g0t4 / docker-compose.yml
Created May 18, 2016
TeamCity Docker Compose setup
View docker-compose.yml
version: '2'
services:
teamcity:
image: sjoerdmulder/teamcity
ports:
- 8111:8111
teamcity-agent:
image: sjoerdmulder/teamcity-agent
environment:
@g0t4
g0t4 / System.tap.js
Last active Apr 2, 2021
SystemJS / jspm course components that might need updates
View System.tap.js
var normalize = System.normalize;
System.normalize = function (name, parentName, parentAddress) {
console.log("normalize: " + JSON.stringify({
name: name,
parentName: parentName,
parentAddress: parentAddress
}));
return normalize.call(this, name, parentName, parentAddress);
};
@g0t4
g0t4 / gist:a97bcc64dff4ac9394ef
Created Nov 5, 2014
Building an QueryAnalysis instances that contain the results of compiling and executing the query, then using this to find rules and rule violations
View gist:a97bcc64dff4ac9394ef
private QueryAnalysis[] GetQueriesToAnalyze()
{
var queries = _Project.GetRulesInProjectFileAndInRuleFilesAndDeclaredInSourceCode(_Analysis.RulesExtractedFromCode).RootParent;
var activeQueries = queries.GetActiveQueries();
var compiledQueriesByQueryString = GetCompiledQueriesByQueryString(activeQueries);
var justMyCode = queries.ComputeJustMyCode(_Analysis.CodeBase);
return activeQueries
.Select(query => new QueryAnalysis(query, compiledQueriesByQueryString[query.QueryString], justMyCode, _Project))
.ToArray();
@g0t4
g0t4 / ArgumentBuilder.kt
Created Oct 24, 2014
Demonstrating one off extension functions in Kotlin for improving readability
View ArgumentBuilder.kt
public class ArgumentBuilder(private val runnerParameters: Map<String, String>) {
public fun build(): List<String> {
return arrayListOf<String>()
.addIfSet("--Project", RunnerSettings.PROJECT_FILE)
.addIfSet("--Output", RunnerSettings.OUTPUT)
.addFlagIfSet("--Flag1", RunnerSettings.FLAG_1)
.addFlagIfSet("--Flag2", RunnerSettings.FLAG_2)
.addFlagIfSet("--Flag3", RunnerSettings.FLAG_3)
.addMultipleIfSet("--InputFiles", RunnerSettings.INPUTS)
@g0t4
g0t4 / tap.kt
Created Oct 15, 2014
A ruby like tap method for kotlin, except for any type
View tap.kt
/**
* Provide a means to fluently tap into a chain of method calls so as not to need to declare unnecessary variables
* */
public fun <T : Any, R> T.tap(tap: (T) -> R): T {
tap(this)
return this
}
// here's an example where I'm in a fluent builder and I'd like to log the URI of the request without introducing a variable
val response = this.builds.queryParam("locator", "buildType:{buildTypeId},count:1,personal:false,canceled:false")