This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name No More HN Discussions | |
// @version 0.0.1 | |
// @grant none | |
// @include https://news.ycombinator.com/* | |
// ==/UserScript== | |
// hide all comments | |
const allTableLinks = document.querySelectorAll('td.subtext > a') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Jenkins - select all plugins | |
// @version 0.1 | |
// @description provides a utility button to allow you to select all Jenkins plugins at once | |
// @author Alex Chesters | |
// @match https://ci.itv.test.tools.bbc.co.uk/pluginManager/ | |
// ==/UserScript== | |
const selectAll = () => { | |
const allInputs = document.querySelectorAll('table input') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const UKPD = require('ukpd') | |
try { | |
const data = await UKPD.streetLevel('52.629729', '-1.131592', '2016-07') | |
console.log(`there were ${data.length} crimes in the area during 2016-07`) | |
} catch (err) { | |
console.error('An error occurred', err) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const invertPromise = (promise) => new Promise( | |
(resolve, reject) => promise.then(reject, resolve) | |
) | |
const raceToSuccess = (promises) => invertPromise( | |
Promise.all(promises.map(invertPromise)) | |
) | |
const fast = () => { | |
return new Promise((resolve) => { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"Description": "A Budget, with alarm, to monitor My Component", | |
"Resources": { | |
"EmailTopic": { | |
"Type": "AWS::SNS::Topic", | |
"Properties": { | |
"Subscription": [ | |
{ | |
"Endpoint": "bill.bob@gmail.com", | |
"Protocol": "email" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import boto3 | |
client = boto3.client(‘rekognition’, region_name=’eu-west-1') | |
def compare_faces(source_image_path, target_image_path): | |
source_image = open(source_image_path, ‘rb’) | |
target_image = open(target_image_path, ‘rb’) | |
response = client.compare_faces( | |
SourceImage={‘Bytes’: bytearray(source_image.read())}, | |
TargetImage={‘Bytes’: bytearray(target_image.read())} | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
stage('Set the build display name') { | |
steps { | |
script { | |
CURRENT_BRANCH = sh(returnStdout: true, script: 'git rev-parse --abbrev-ref HEAD').trim() | |
CURRENT_HASH = sh(returnStdout: true, script: 'git rev-parse --short HEAD').trim() | |
currentBuild.displayName = "$CURRENT_BRANCH - $CURRENT_HASH" | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pipeline { | |
stages { | |
stage('Preparation') { | |
env.mvnHome = tool 'M3' | |
} | |
stage('Build') { | |
sh "'${mvnHome}/bin/mvn' -Dmaven.test.failure.ignore clean package" | |
} | |
} | |
post { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
node { | |
try { | |
def mvnHome | |
stage('Preparation') { | |
git 'https://github.com/jglick/simple-maven-project-with-tests.git' | |
mvnHome = tool 'M3' | |
} | |
stage('Build') { | |
sh "'${mvnHome}/bin/mvn' -Dmaven.test.failure.ignore clean package" | |
} |
NewerOlder