Skip to content

Instantly share code, notes, and snippets.

View khaliqgant's full-sized avatar
💯
👨🏿‍💻

Khaliq khaliqgant

💯
👨🏿‍💻
View GitHub Profile
@khaliqgant
khaliqgant / tab.bash
Last active March 16, 2022 08:53 — forked from bobthecow/tab.bash
[Open Terminal Tab From CLI] Open new Terminal tabs from the command line #cli #bash
#!/bin/bash
#
# Open new Terminal tabs from the command line
#
# Original Author: Justin Hileman (http://justinhileman.com)
# Modified By: Khaliq Gant (http://khaliqgant.com)
# Installation:
# Add the following function to your `.bashrc` or `.bash_profile`,
# or save it somewhere (e.g. `~/.tab.bash`) and source it in `.bashrc` or `.zshrc`
@khaliqgant
khaliqgant / 1_overlap.js
Last active March 16, 2022 08:52 — forked from mxriverlynn/1_overlap.js
[Date Range Overlap] checking for date range overlap #javascript
// this function takes an array of date ranges in this format:
// [{ start: Date, end: Date}]
// the array is first sorted, and then checked for any overlap
function overlap(dateRanges){
var sortedRanges = dateRanges.sort((previous, current) => {
// get the start date from previous and current
var previousTime = previous.start.getTime();
var currentTime = current.start.getTime();