Skip to content

Instantly share code, notes, and snippets.

View jeff-heienickle's full-sized avatar

Jeff Heienickle jeff-heienickle

  • Weldon Spring, Missouri
View GitHub Profile
import base64
import json
import hmac
import hashlib
encoding = "utf-8"
secret = "<API_KEY_SHARED_SECRET>".encode(encoding)
iat = 1600116847
exp = 1600203247
@jeff-heienickle
jeff-heienickle / PostmanDecodeJWT.js
Last active May 31, 2024 10:45
Decode, reuse, and visualize a JWT in Postman
var jsonData = pm.response.json();
pm.environment.set("jwt", jsonData.access_token);
function parseJwt (token,part) {
var base64Url = token.split('.')[part];
var words = CryptoJS.enc.Base64.parse(base64Url);
var jsonPayload = CryptoJS.enc.Utf8.stringify(words);
return JSON.parse(jsonPayload);
};
@jeff-heienickle
jeff-heienickle / codedeploy-to-slack.js
Created December 23, 2020 16:15 — forked from teeli/codedeploy-to-slack.js
CodeDeploy notifications to Slack (AWS Lambda via SNS)
var https = require('https');
var util = require('util');
exports.handler = function (event, context) {
console.log(JSON.stringify(event, null, 2));
console.log('From SNS:', event.Records[0].Sns.Message);
var severity = "good";
var message = event.Records[0].Sns.Message;
var messageJSON = JSON.parse(message);
@jeff-heienickle
jeff-heienickle / spool-csv.sql
Created March 8, 2019 15:40
How to spool to csv in in SQL developer
spool c:\temp\db.csv
select /*csv*/ * from v$database;
spool off
@jeff-heienickle
jeff-heienickle / guid.cmd
Created March 8, 2019 15:24
Guid to Clip powershell
POWERSHELL -c "[guid]::NewGuid().ToString().ToUpper()" | clip
@jeff-heienickle
jeff-heienickle / find.ps1
Created March 8, 2019 15:17
find count powershell
#Quick and dirty PS script for counting lines of code in a directory. Output is dumped to a simple CSV file.
#Note that this script doesn't count blank lines.
#Parameters:
# path - the path containing the code files (note that the script will recurse through subfolders
# outputFile - fully qualified path of the file to dump the CSV output
# include (Optional) - file mask(s) to include in the count (deafults to *.*)
# exclude (Optional) - file mask(s) to exclude in the count (defaults to none)
# Example (count lines in target path including *.cs but excluding *.designer.cs)
# .\find.ps1 -path "C:\Source" -outputFile "C:\Temp\out.csv" -include "*.js" -find "LocalStorage"
param([string]$path, [string]$outputFile, [string]$include = "*.*", [string]$exclude = "", [string]$find = "")