Skip to content

Instantly share code, notes, and snippets.

View consoledotblog's full-sized avatar

consoledotblog

View GitHub Profile
@consoledotblog
consoledotblog / collection_init.java
Created February 26, 2016 19:23 — forked from jmccance/collection_init.java
Overcoming Immutability in Scala
final List<String> fullNames = new ArrayList<>();
for (Name name : names) {
fullNames.add(String.format("%s %s", name.getFirst(), name.getLast()));
}
@consoledotblog
consoledotblog / job-generator.yml
Last active January 14, 2016 20:09 — forked from jamesggraf/job-generator.yml
Jenkins Job Builder with Job DSL
---
- job:
name: job-generator
builders:
- dsl:
script-text:
!include-raw hello-world.dsl
//IMPORTANT NOTE!!!: Name this file "job-generation.dsl". Github's gist tool uses the file extension to establish syntax highlighting rules
@GrabResolver(name="repo.jenkins-ci.org",root='http://repo.jenkins-ci.org/public/')
@Grapes([
@Grab(group='org.kohsuke', module='github-api', version='1.59')
])
import static hudson.security.ACL.SYSTEM
import com.cloudbees.plugins.credentials.CredentialsProvider
@consoledotblog
consoledotblog / hello-world.dsl
Created January 14, 2016 20:09 — forked from jamesggraf/hello-world.dsl
Job DSL Hello World
job {
name 'hello-world'
steps {
shell('echo "Hello World!"')
}
}
@consoledotblog
consoledotblog / jjb_execution.sh
Created January 14, 2016 20:09 — forked from jamesggraf/jjb_execution.sh
Execute your jenkins job builder job
#!/usr/bin/env bash
sudo jenkins-jobs update hello_world.yml
@consoledotblog
consoledotblog / hello_world.yml
Created January 14, 2016 20:08 — forked from jamesggraf/hello_world.yml
Example Hello World Jenkins Job Builder Definition
---
- job:
name: my_hello_world_job
parameters:
- string:
name: Message
default: Hello World
description: A message to echo
builders:
- shell: "echo $Message"
@consoledotblog
consoledotblog / jenkins_jobs.ini
Created January 14, 2016 20:08 — forked from jamesggraf/jenkins_jobs.ini
Configure Jenkins Job Builder
[job_builder]
ignore_cache=True
keep_descriptions=False
include_path=.
recursive=False
allow_duplicates=False
[jenkins]
user=YOUR_USER_NAME
password=YOUR_PASSWORD_OR_API_KEY
@consoledotblog
consoledotblog / installJJB.sh
Created January 14, 2016 20:08 — forked from jamesggraf/installJJB.sh
Install Jenkins Job Builder
#!/usr/bin/env bash
git clone git@github.com:openstack-infra/jenkins-job-builder.git
cd jenkins-job-builder
python setup.py install
pip install pbr
@consoledotblog
consoledotblog / bawts-20.js
Created January 14, 2016 17:16 — forked from Nijhazer/bawts-20.js
Building Applications with TypeScript - Snippet 20
/*
* Import the libaries that we're using.
* This is a test of API code, so any libraries
* specified in package.json should be available
* for import here.
*/
import chai = require('chai');
import chaiAsPromised = require("chai-as-promised");
import sinon = require('sinon');
@consoledotblog
consoledotblog / bawts-19.js
Created January 14, 2016 17:16 — forked from Nijhazer/bawts-19.js
Building Applications with TypeScript - Snippet 19
var KarmaServer = KarmaServer = require('karma').Server;
gulp.task('test:www', ['compile:www'], function (done) {
new KarmaServer({
configFile: __dirname + '/karma.conf.js',
singleRun: true
}, done).start();
});