Skip to content

Instantly share code, notes, and snippets.

@jmrozanec
jmrozanec / gist:3fc53831549451f77631fac296e2263c
Created August 13, 2020 17:28 — forked from debasishg/gist:8172796
A collection of links for streaming algorithms and data structures
  1. General Background and Overview
public static void main(String[] args) {
CronDefinition cronDefinition = CronDefinitionBuilder.instanceDefinitionFor(QUARTZ);
CronParser parser = new CronParser(cronDefinition);
Cron quartzCron = parser.parse("0 23 * ? * 1-5 *");
ExecutionTime executionTime = ExecutionTime.forCron(quartzCron);
ZonedDateTime lastExecution = ZonedDateTime.ofInstant(new Date().toInstant(), ZoneId.systemDefault());
Optional<ZonedDateTime> lastExec = executionTime.lastExecution(lastExecution);
@jmrozanec
jmrozanec / jenkins-slack-messages.groovy
Last active December 5, 2018 09:40
Provides formatted messages to notify build status through Slack
def shallWeNotify(String policy, String lastStatus, String currentStatus) {
switch(policy){
case 'all-builds':
return true;
case 'status-change':
return !lastStatus.equals(currentStatus)
case 'unstable-builds':
return currentStatus.equals('UNSTABLE') || currentStatus.equals('FAILURE')
case 'broken-builds':
return currentStatus.equals('FAILURE')
Oct 26, 2018 6:27:45 AM hudson.model.UpdateCenter$DownloadJob run
INFO: Starting the installation of SSH Agent on behalf of admin
Oct 26, 2018 6:27:46 AM hudson.model.UpdateCenter$UpdateCenterConfiguration download
INFO: Downloading SSH Agent
Oct 26, 2018 6:27:48 AM hudson.model.UpdateCenter$DownloadJob run
INFO: Starting the installation of SSH Agent on behalf of admin
Oct 26, 2018 6:27:48 AM io.jenkins.plugins.casc.Attribute setValue
INFO: Setting hudson.security.GlobalMatrixAuthorizationStrategy@976cde1.grantedPermissions = [Overall/Read:anonymous, Job/Read:anonymous, View/Read:anonymous, Overall/Administer:authenticated]
Oct 26, 2018 6:27:48 AM io.jenkins.plugins.casc.impl.configurators.DataBoundConfigurator tryConstructor
INFO: Setting class com.nirima.jenkins.plugins.docker.DockerCloud.name = docker
plugins:
sites:
- id: "default"
url: "https://updates.jenkins.io/update-center.json"
required:
configuration-as-code-support: latest
command-launcher: latest
jdk-tool: latest
ssh-slaves: latest
ssh-credentials: latest
clouds:
- docker:
containerCap: 5
dockerApi:
connectTimeout: 60
dockerHost:
uri: "tcp://127.0.0.1:2375"
readTimeout: 60
exposeDockerHost: true
name: "docker"