Skip to content

Instantly share code, notes, and snippets.

View twosdai's full-sized avatar
🐶
🐱

Daniel Wasserlauf twosdai

🐶
🐱
View GitHub Profile
@twosdai
twosdai / key.md
Created February 28, 2019 00:45
Twitter (un)official Consumer Key

Twitter Official Consumer Key

Twitter for Android

type:            PIN
Consumer key:    3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPhone

type:            PIN

Consumer key: IQKbtAYlXLripLGPWd0HUA

@twosdai
twosdai / key.md
Created February 28, 2019 00:45
Twitter (un)official Consumer Key

Twitter Official Consumer Key

Twitter for Android

type:            PIN
Consumer key:    3nVuSoBZnx6U4vzUxf5w
Consumer secret: Bcs59EFbbsdF6Sl9Ng71smgStWEGwXXKSjYvPVt7qys

Twitter for iPhone

type:            PIN

Consumer key: IQKbtAYlXLripLGPWd0HUA

// Just run npm i @aws-sdk/client-pricing --save-dev
// I tested the below commands with Node Version: 14.19.2 on PopOS Linux
const {
PricingClient,
DescribeServicesCommand,
GetAttributeValuesCommand,
GetProductsCommand,
} = require('@aws-sdk/client-pricing');
const { promises } = require('fs');
@twosdai
twosdai / RoleAssumption.md
Last active June 21, 2022 18:31
IAM cross account Role assumptions

Role Assumption

Purpose

This article describes how to create a IAM role and enable access for the Paigo Account.

Requirements

  • An AWS account
  • Access to manage and create IAM roles
@twosdai
twosdai / prom.yml
Created July 13, 2022 06:45
Prometheus configuration for basic scraping and remote write.
apiVersion: rbac.authorization.k8s.io/v1
kind: ClusterRole
metadata:
name: prometheus
rules:
- apiGroups: ['']
resources:
- nodes
- nodes/proxy
- services
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:
Y. _
YiL .```.
Yii; YC IS 1337 .; .;;`.
YY;ii._ .;`.;;;; :
iiYYYYYYiiiii;;;;i` ;;::;;;;
_.;YYYYYYiiiiiiYYYii .;;. ;;;
.YYYYYYYYYYiiYYYYYYYYYYYYii;` ;;;;
.YYYYYYY$$YYiiYY$$$$iiiYYYYYY;.ii;`..
:YYY$!. TYiiYY$$$$$YYYYYYYiiYYYYiYYii.
Y$MM$: :YYYYYY$!"``"4YYYYYiiiYYYYiiYY.
//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
@twosdai
twosdai / taxJarImpl.js
Created January 11, 2024 17:43
TaxJar Testing
// 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 {
// 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 = [];