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
class TaskQueue { | |
constructor(concurrency = 1) { | |
this.concurrency = concurrency; | |
this.running = 0; | |
this.queue = []; | |
} | |
pushTask(task) { | |
this.queue.push(task); | |
this.next(); |
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
#!/bin/bash | |
################################################################## | |
# Step 1: Sign in to Jira and create an API token at this link: | |
# https://id.atlassian.com/manage-profile/security/api-tokens | |
# | |
# Step 2: Create a file named ~/.jiraconfig and add the following: | |
# JIRA_USER={fname.lname@simplybusiness.co.uk} | |
# JIRA_API_TOKEN={your-api-token} | |
# JIRA_PROJECT_KEY={jira-project-key} e.g. FETT |
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
type LogLevel = "log" | "info" | "error" | "debug" | "warning"; | |
class Logger { | |
constructor() { | |
this.module = console; | |
} | |
format(message: string, level: LogLevel = "log"): string { | |
const dateTime = new Date().toISOString(); | |
return JSON.stringify({ time: dateTime, level, message }); |
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
-- Get all of today's rides that have no riders | |
SELECT r.id from Ride r | |
LEFT OUTER JOIN ( | |
SELECT rideId, CAST(count(*) as UNSIGNED) cnt | |
FROM UsersOnRides | |
GROUP BY rideId | |
) ur ON ur.rideId = r.id | |
where DATE_FORMAT(r.date,'%d/%m/%Y') = DATE_FORMAT(NOW(),'%d/%m/%Y') | |
and COALESCE(ur.cnt,0) = 0; |
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
// Add unique partial urls to this list and the Chatbot will automatically open on them | |
const pagesWithChatbotOpen = [ | |
"Instant-help-with-our-chatbot", | |
// "Give-us-a-call", | |
]; | |
const delay = 2500; // 500ms = 0.5s | |
const urlIsInList = pagesWithChatbotOpen.filter(page => location.pathname.includes(page)).length > -1; | |
document.addEventListener("DOMContentLoaded", () => { |