Skip to content

Instantly share code, notes, and snippets.

{
"mappings": {
"asset": {
"properties": {
"display_name": {
"type": "text"
}
}
}
}
{
"mappings": {
"asset": {
"properties": {
"email":{
"type":"text"
},
"email_v2 (mutated field)":{
"type":"text",
"fields":{
@david-bc
david-bc / parallelBuild.groovy
Created September 18, 2017 20:36
Deployment Pipeline - Parallel Build
node {
stage('Build Servers') {
for (int i = 0; i < params.NUM_OF_NODES.toInteger() ; i++) {
stage ("BuildNode_${node}") {
BUILD_NODES["BuildNode_${node}"] = {
sh "gcloud compute disks….."
}
}
}
parallel BUILD_NODES
@david-bc
david-bc / manualSteps.groovy
Created September 18, 2017 20:35
Deployment Pipelines - Manual Steps
node {
stage('Build & Unit Test') {
gradle.run 'clean build'
}
stage('Code Quality') {
withSonarQubeEnv('SonarQube') {
gradle.run 'sonarqube --info'
}
}
stage('Docker Image Push') {
@david-bc
david-bc / buildSteps.groovy
Last active September 18, 2017 20:36
Development Pipeline Scripts
node {
stage('Build & Unit Test') {
gradle.run 'clean build'
}
stage('Code Quality') {
withSonarQubeEnv('SonarQube') {
gradle.run 'sonarqube --info'
}
}
stage('Docker Image Push') {
@david-bc
david-bc / hmac.js
Created September 7, 2017 16:31
Postman Pro Blog Snippets
function get_path() {
var resolvedUrl = request.url.replace(/{{(\w*)}}/g,function(str,key) {return getFromEnv(key)});
return /.+?\:\/\/.+?(\/.+?)(?:# \? $)/.exec(resolvedUrl)[1]
}
function auth_string(version, lookup, signature) {
return // a secret formula
}
function getFromEnv(key) {
return environment[key] ? environment[key] : postman.getGlobalVariable(key);
}
@david-bc
david-bc / testing.js
Last active June 22, 2017 05:31
test
alert('Hello, World!');
console.log({
$: $,
chrome: chrome,
extension: chrome.extension
});
$.get('https://api.bitbucket.org/2.0/repositories?src=xss')
.then(function(data, status, xhr) {
console.log({
data: data,
@david-bc
david-bc / README.md
Last active May 8, 2017 21:03
j2j4J: JSON to JSON for Java Transformation Proposal

Intro

There are 3 pieces of a transformation:

  • input: The source
  • spec: The strategy for transforming the input
  • output: The result of the transformation.

So output = spec(input).

@david-bc
david-bc / build.gradle
Created April 19, 2017 18:37
Gradle Dependencies
compile('org.projectlombok:lombok')
compile group: 'com.google.guava', name: 'guava', version: '19.0'
@david-bc
david-bc / wf-scripts.md
Last active April 14, 2017 13:29
Suspend All Workflows

Useful Scripts for Manage BetterCloud Workflows

Setup

Before you can run the following "bookmark scripts" you will need to save your X-Authorization header as a global variable. It is easier than it sounds ;)

In Chrome, go to the Workflows Manager page and open the Admin Console, then go to the Network tab and click the XHR button at the top.

Find a request that look like metaworkflow?page=1&amp;pageSize=15&amp;sortColumn=name&amp;sortDir=ASC or