Skip to content

Instantly share code, notes, and snippets.

View rtrcolin's full-sized avatar

Colin McLeod rtrcolin

  • Rent The Runway
  • New York
View GitHub Profile
@rtrcolin
rtrcolin / jiraRefreshTickets.js
Last active January 8, 2024 13:59
Super simple Google Docs integration with Jira Issues/Tickets
// URL for Jira's REST API for issues
var getIssueURL = "https://[Your Jira host]/rest/api/2/issue/";
// Personally I prefer the script to handle request failures, hence muteHTTPExceptions = true
var fetchArgs = {
contentType: "application/json",
headers: {"Authorization":"Basic [Your BASE64 Encoded user:pass]"},
muteHttpExceptions : true
};
@rtrcolin
rtrcolin / gist:3123161
Created July 16, 2012 14:56
Quartz Health Check
import com.yammer.metrics.core.HealthCheck;
import org.quartz.SchedulerException;
...
public class QuartzHealthCheck extends HealthCheck {
private QuartzManager quartzManager;
public QuartzSchedulerHealthCheck(QuartzManager qm) throws SchedulerException {
super("Quartz Scheduler Health Check");
this.quartzManager = qm;
@rtrcolin
rtrcolin / gist:3121429
Created July 16, 2012 07:53
Quartz Configuration
import com.yammer.dropwizard.config.Configuration;
...
public class QuartzConfiguration extends Configuration {
@Valid
@JsonProperty
private Map<String,String> quartzSettings = new HashMap<String, String>();
public Properties getSchedulerFactoryProperties(){
Properties sfProps = new Properties();
@rtrcolin
rtrcolin / gist:3121364
Created July 16, 2012 07:31
Example Jobs XML
<?xml version='1.0' encoding='utf-8'?>
<job-scheduling-data xmlns="http://www.quartz-scheduler.org/xml/JobSchedulingData"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.quartz-scheduler.org/xml/JobSchedulingData http://www.quartz-scheduler.org/xml/job_scheduling_data_2_0.xsd"
version="2.0">
<schedule>
<job>
<name>MySimpleJob</name>
<group>DailyJobs</group>
@rtrcolin
rtrcolin / gist:3121351
Created July 16, 2012 07:26
Dropwizard Quartz Service YML
# Other settings
# would go here
# Quartz Scheduler configuration
quartzSettings:
instanceName: MyQuartzScheduler
threadPoolClass: org.quartz.simpl.SimpleThreadPool
threadCount: 5
threadPriority: 5
jobStoreClass: org.quartz.simpl.RAMJobStore
@rtrcolin
rtrcolin / QuartzManager.java
Created July 16, 2012 07:16
Quartz Managed by Dropwizard
public class QuartzManager implements Managed {
private Scheduler scheduler;
private QuartzSchedulerMonitor schedulerMonitor;
private QuartzJobMonitor jobMonitor;
public QuartzManager(SchedulerFactory sf) throws SchedulerException {
scheduler = sf.getScheduler();
schedulerMonitor = new QuartzSchedulerMonitor(); // Implements SchedulerListener
scheduler.getListenerManager().addSchedulerListener(schedulerMonitor);
@rtrcolin
rtrcolin / QuartzService.java
Created July 16, 2012 06:56
Dropwizard Quartz Service
import com.yammer.dropwizard.Service;
...
public class QuartzService extends Service<QuartzConfiguration> {
public static void main(String[] args) throws Exception {
new Quartz Service().run(args);
}
public QuartzService() {
super("Quartz Service");