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
function gas() { | |
local repo_dir branch owner repo api_url gh_status conclusion color | |
# Ensure GITHUB_TOKEN is set | |
if [[ -z "$GITHUB_TOKEN" ]]; then | |
echo "❌ GITHUB_TOKEN is not set. Export it in your shell environment." | |
return 1 | |
fi | |
# Find the Git repo root |
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
// Description: This script registers a webhook, tests it, and then unregisters it. | |
// Run npm install cross-fetch to install the cross-fetch package. you can also use node-fetch but the ESM module system will struggle with it. | |
// To run the script, run: node webHookRegisterAndTest.js | |
const fetch = require("cross-fetch"); | |
const apiKey = "EXAMPLE_API_KEY"; | |
const webhookUrl = "https://public.prod.tenex.email/webhooks/register"; | |
const testWebhookUrl = "https://public.prod.tenex.email/webhooks/test"; | |
const unregisterWebhookUrl = "https://public.prod.tenex.email/webhooks/"; |
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 fetch = require('cross-fetch'); | |
async function fetchAndCheckLeadsForTrackingmore(url) { | |
let offset = 0; | |
const limit = 100; | |
let totalLeads = Infinity; // Initial dummy value | |
while (offset < totalLeads) { | |
try { | |
const response = await fetch(`${url}&offset=${offset}&limit=${limit}`); |
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 fetch = require("cross-fetch"); | |
async function fetchAllLeads(url) { | |
const leadsMap = new Map(); | |
let offset = 0; | |
const limit = 100; | |
let totalLeads = Infinity; // initial dummy value | |
while (offset < totalLeads) { | |
try { |
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
// Read in a CSV file and check for errors | |
// Usage: node csvChecker.js <filename> | |
// Example: node csvChecker.js test.csv | |
const fs = require('fs'); | |
const csv = require('csv-parser'); | |
const createCsvWriter = require('csv-writer').createObjectCsvWriter | |
const results = []; |
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
// Below is our basic function call implementation Treat this as Psudeo Code | |
// npm init -y | |
// npm i taxjar --save | |
const TaxJar = require("taxjar"); | |
const taxjarClient = new TaxJar({ | |
apiKey: "FILLMEIN", | |
apiUrl: "https://api.sandbox.taxjar.com", | |
}); | |
const calculateSalesTax = async () => { | |
try { |
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 fetch = require("node-fetch"); | |
const apiEndpoint = "http://api.open-notify.org/iss-now.json"; | |
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms)); | |
/** | |
* | |
* Below are a few examples of how to use async stuff inside of JS. I am using the ISS now API for the async request. | |
*/ | |
// To force some ASYNC method to run synchronously, I reccomend using a for loop or a do while loop to force the code to run in order. | |
// This is useful for pagination or when you really need to be sure that a previous request executed before the next one. I reccomend only doing this if you have less than 20 Http calls to make. total |
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
Y. _ | |
YiL .```. | |
Yii; YC IS 1337 .; .;;`. | |
YY;ii._ .;`.;;;; : | |
iiYYYYYYiiiii;;;;i` ;;::;;;; | |
_.;YYYYYYiiiiiiYYYii .;;. ;;; | |
.YYYYYYYYYYiiYYYYYYYYYYYYii;` ;;;; | |
.YYYYYYY$$YYiiYY$$$$iiiYYYYYY;.ii;`.. | |
:YYY$!. TYiiYY$$$$$YYYYYYYiiYYYYiYYii. | |
Y$MM$: :YYYYYY$!"``"4YYYYYiiiYYYYiiYY. |
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
apiVersion: v1 | |
kind: Service | |
metadata: | |
labels: | |
app.kubernetes.io/component: exporter | |
app.kubernetes.io/name: kube-state-metrics | |
app.kubernetes.io/version: 2.5.0 | |
name: kube-state-metrics | |
namespace: kube-system | |
spec: |
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
apiVersion: rbac.authorization.k8s.io/v1 | |
kind: ClusterRole | |
metadata: | |
name: prometheus | |
rules: | |
- apiGroups: [''] | |
resources: | |
- nodes | |
- nodes/proxy | |
- services |
NewerOlder