This file contains hidden or 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 retryWithBackoff = (eventuallyTrue, callback, retries = 10, msDelay = 100) => { | |
| if (eventuallyTrue()) { | |
| callback(); | |
| } else if (retries > 0) { | |
| setTimeout(() => retryWithBackoff(eventuallyTrue, --retries, msDelay * 2, callback), msDelay); | |
| } | |
| }; |
This file contains hidden or 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 {expect} = require("chai"); | |
| let asyncValue = null; | |
| function slowPromise() { | |
| return new Promise((resolve, reject) => { | |
| let wait = setTimeout(() => { | |
| clearTimeout(wait); | |
| console.log("Timeout complete"); | |
| resolve("Finished"); |
This file contains hidden or 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
| configure { | |
| it / 'publishers' / 'jenkins.plugins.slack.SlackNotifier'(plugin: "slack@2.0.1") { | |
| teamDomain('myteam') | |
| authToken('mytoken') | |
| buildServerUrl('http://mydomain:8080/') | |
| room('#my-room') | |
| notifyUnstable(true) | |
| notifyFailure(true) | |
| notifyBackToNormal(true) | |
| includeTestSummary(true) |
This file contains hidden or 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
| package com.recursivechaos.rcutils; | |
| import java.text.SimpleDateFormat; | |
| import java.util.Calendar; | |
| import java.util.Date; | |
| import java.util.Locale; | |
| import org.apache.commons.logging.Log; | |
| import org.apache.commons.logging.LogFactory; |
This file contains hidden or 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 java.util.List; | |
| import com.github.jreddit.user.Comment; | |
| import com.github.jreddit.user.User; | |
| public class Main { | |
| public static void main(String[] args) throws Exception { | |
| // Provide user account for credentials | |
| User user = new User("username","password"); | |
| user.connect(); |
This file contains hidden or 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 java.io.File; | |
| import java.io.FileInputStream; | |
| import java.io.IOException; | |
| import java.io.InputStreamReader; | |
| import com.Ostermiller.util.CSVParser; | |
| import com.Ostermiller.util.LabeledCSVParser; | |
| /** | |
| * Opens a csv file, grabs the label, and fetches fields via label names. |