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
#!/bin/bash | |
set -e # exit when a command fails, so we don't continue doing next steps! | |
function check_exists { | |
CMD="$1" | |
# "type" works nicely for checking existence of both shell functions and scripts/bins | |
if type -t "$CMD" 1> /dev/null 2>/dev/null; then | |
true | |
else | |
false |
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
class BulkResponse { | |
String subject; | |
} | |
bulkResponse = new BulkResponse(subject:'Hi Rohit!') | |
//-- | |
class ThreadResponse extends BulkResponse { | |
String campaignName; | |
} |
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 date = new Date("2022-06-27T00:49:00Z"); | |
// yoinked from https://flaviocopes.com/how-to-list-object-methods-javascript/ | |
const getMethods = (obj) => { | |
let properties = new Set() | |
let currentObj = obj | |
do { | |
Object.getOwnPropertyNames(currentObj).map(item => properties.add(item)) | |
} while ((currentObj = Object.getPrototypeOf(currentObj))) | |
return [...properties.keys()].filter(item => typeof obj[item] === 'function') |
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
#!/usr/bin/env /usr/local/bin/node | |
// <xbar.title>Current ISP name</xbar.title> | |
// <xbar.version>v2.1.7-beta</xbar.version> | |
// <xbar.author>Dan Kordik</xbar.author> | |
// <xbar.author.github>dkordik</xbar.author.github> | |
// <xbar.desc>Displays current ISP name</xbar.desc> | |
// <xbar.dependencies></xbar.dependencies> | |
const http = require("http"); |
OlderNewer