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
#!/usr/bin/env python3 | |
import re | |
import subprocess | |
from typing import List | |
## ------------ FUNCTIONS ------------ ## | |
def create_branch_from_ticket(issue_type: str, issue_key: str, issue_title: str) -> str: | |
# format issue_title to replace spaces with - and remove any non-alphanumeric chars |
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
function tunnelPath(startPoint, endPoint, tunnels) { | |
const manhattan = function(p1, p2) { | |
return Math.abs(p1[0] - p2[0]) + Math.abs(p1[1] - p2[1]); | |
} | |
//init shortest to above ground between points | |
let shortestPath = manhattan(startPoint, endPoint); | |
const entrances = tunnels.map(item => [item[0], item[1]]); | |
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
/** | |
* @param {number[][]} envelopes | |
* @return {number} | |
*/ | |
var maxEnvelopes = function(envelopes) { | |
let maxNested = 0; | |
let sorted = envelopes.slice(0).sort((a,b) => { | |
return (b[0] + b[1] - a[0] - a[1]) |
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 Cashier { | |
constructor(//string priceList, float startingMoney, float salesTax){ | |
//parse the csv priceList and store it as a nested json, where for each product key = sku, value =a json object of the products other properties | |
//Store the other parameters in respective properties | |
//Initialize a boolean inTransaction property to false. | |
//Initialize a transactions object where the key is transaction id, and values | |
//are a csv string of transacition details | |
} | |
function viewBalance() { |
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
/** | |
* @param {number} capacity | |
*/ | |
var LFUCache = function(capacity) { | |
this.capacity = capacity; | |
this.storage = {}; | |
}; | |
/** | |
* @param {number} key |
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
/** | |
* @param {string} s | |
* @param {string} t | |
* @return {boolean} | |
*/ | |
var isSubsequence = function(s, t) { | |
if(!s.length) { | |
return true; | |
} | |
let threads = []; |
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
var frequencySort = function(s) { | |
let charCounts = {}; | |
for(let i = 0; i < s.length; i++) { | |
if(charCounts[s[i]]) { | |
charCounts[s[i]] += 1; | |
} else { | |
charCounts[s[i]] = 1; | |
} |
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 messageBus { | |
constructor() { | |
this.subscribers = {}; | |
} | |
subscribe(topic, cb) { | |
if (this.subscribers[topic]) { | |
this.subscribers[topic].push(cb) | |
} else { | |
this.subscribers[topic] = [cb]; |
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
/* | |
* A function that takes an array of lowercase characters and returns | |
* an array in which all of the vowels are repeated. | |
* Time complexity: O(n) | |
* Space complexity: O(1) | |
*/ | |
const vowelDoubler = function(arr) { | |
let numVowels = 0; | |
const vowels = new Set(['a', 'e', 'i', 'o', 'u']); | |
for(let i = 0; i < arr.length; i++) { |
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
muncheez=# SELECT * FROM restaurants WHERE id=0; | |
id | name | address | url | phone | hours | lat | long | |
----+--------------+-----------------+---------------------+--------------+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+----------+---------- | |
0 | Magenta Coke | 2482 Marco Burg | https://haylee.info | 541-917-8798 | Monday: 9:00 AM – 9:00 PM, Tuesday: 9:00 AM – 9:00 PM, Wednesday: 9:00 AM – 9:00 PM, Thursday: 9:00 AM – 9:00 PM, Friday: 9:00 AM – 9:00 PM, Saturday: 9:00 AM – 9:00 PM, Sunday: 9:00 AM – 9:00 PM | -33.5837 | -146.592 | |
(1 row) | |
muncheez=# SELECT * FROM restaurants WHERE name='Magenta Coke'; | |
id | nam |
NewerOlder