Skip to content

Instantly share code, notes, and snippets.

View cicorias's full-sized avatar

Shawn Cicoria cicorias

View GitHub Profile

OpenSSL Playground

Verify downloaded file
➜  openssl dgst -sha256 openssl-1.1.1.tar.gz
SHA256(openssl-1.1.1.tar.gz)= 2836875a0f89c03d0fdf483941512613a50cfb421d6fd94b9f41d7279d586a3d
➜  cat openssl-1.1.1.tar.gz.sha256
2836875a0f89c03d0fdf483941512613a50cfb421d6fd94b9f41d7279d586a3d
RSA Public Key pad and encrypt
@cicorias
cicorias / auth0-verify.js
Created May 25, 2020 19:50 — forked from westmark/auth0-verify.js
Auth0 JWT Verification
/**
The MIT License (MIT)
Copyright (c) 2017 Fredrik Westmark
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@cicorias
cicorias / token-generator.js
Created May 23, 2020 10:42 — forked from ziluvatar/token-generator.js
Example of refreshing tokens with jwt
/**
* Example to refresh tokens using https://github.com/auth0/node-jsonwebtoken
* It was requested to be introduced at as part of the jsonwebtoken library,
* since we feel it does not add too much value but it will add code to mantain
* we won't include it.
*
* I create this gist just to help those who want to auto-refresh JWTs.
*/
const jwt = require('jsonwebtoken');
@cicorias
cicorias / jupyter_logging.py
Created May 3, 2020 17:22 — forked from wassname/jupyter_logging.py
simple logging for jupyter or python which outputs to stdout (or a console or terminal) and a log file
"""
In jupyter notebook simple logging to console
"""
import logging
import sys
logging.basicConfig(stream=sys.stdout, level=logging.INFO)
# Test
logger = logging.getLogger('LOGGER_NAME')
@cicorias
cicorias / aws_glacier_delete_vault.md
Created May 3, 2020 15:36 — forked from veuncent/aws_glacier_delete_vault.md
Delete all archives in an AWS Vault

AWS Glacier: Delete vault

Follow these steps to remove all archives from an AWS vault. After this is finished, you will be able to delete the vault itself through the browser console.

Step 1 / Retrieve inventory

This will create a job that collects required information about the vault.

$ aws glacier initiate-job --job-parameters '{"Type": "inventory-retrieval"}' --account-id YOUR_ACCOUNT_ID --region YOUR_REGION --vault-name YOUR_VAULT_NAME 
@cicorias
cicorias / MLP.py
Created April 26, 2020 18:46 — forked from umitanuki/MLP.py
blog-mlp-scripts
import argparse
import sys
import tempfile
from time import time
import random
from os import listdir
from os.path import isfile, join
import pandas
@cicorias
cicorias / Decision_Trees.ipynb
Created April 13, 2020 01:05 — forked from bbartoldson/Decision_Trees.ipynb
Decision Trees with NumPy!
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@cicorias
cicorias / README.md
Created January 13, 2020 23:33 — forked from iki/README.md
Update global top level npm packages

Update global top level npm packages

Problem

npm update -g updates all global packages and their dependencies, see npm/npm#6247.

Solution

  1. Either use the shell script or windows batch here instead.

FWIW: I didn't produce the content presented here (the outline from Edmond Lau's book). I've just copy-pasted it from somewhere over the Internet, but I cannot remember what exactly the original source is. I was also not able to find the author's name, so I cannot give him/her the proper credits.


Effective Engineer - Notes

What's an Effective Engineer?

@cicorias
cicorias / MergeSort.java
Created October 16, 2019 03:16 — forked from louisbros/MergeSort.java
Java Merge Sort
package com.test;
import java.util.ArrayList;
import java.util.List;
public class MergeSort<T extends Comparable<T>> {
public void sort(List<T> values){
mergeSort(0, values.size() - 1, values, new ArrayList<T>(values));
}