Skip to content

Instantly share code, notes, and snippets.

Stanley Zheng stanzheng

Block or report user

Report or block stanzheng

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
stanzheng / aws.txt
Created Jun 25, 2019
Useful Cloud Commands
View aws.txt
# Authenticate ECR
eval $(aws ecr get-login --no-include-email | sed 's|https://||')
View gist:cecac459cceb20492499ba71150bd874
import unittest
def is_binary_search_tree(root):
# Determine if the tree is a valid binary search tree
stack = [(root, -float('inf'), float('inf'))]
while len(stack):
node, lower_bound, upper_bound = stack.pop()
if (node.value <= lower_bound) or (node.value >= upper_bound):
return False
import np
## get all input
claims = [[int(sub_str) for sub_str in re.findall(r'-?\d+', line)] for line in inputz.split('\n')]
## populate an array
canvas = np.zeros((1000,1000))
stanzheng / mlapis.html
Last active Aug 22, 2018
instructor turned off the notebook lol
View mlapis.html
<!DOCTYPE html>
<!-- saved from url=(0086) -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<link rel="shortcut icon" type="image/x-icon" href="">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./mlapis_files/codemirror.css">
<link rel="stylesheet" href="./mlapis_files/style.min.css" type="text/css">
stanzheng / demandforecast.ipynb
Last active Sep 24, 2018
[GCP Data Training August 22, 2018] Analyzing Taxi + Weather data on GCP with BQ and TF
View demandforecast.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
stanzheng / hb_all_books_dl.js
Last active Aug 19, 2018 — forked from graymouser/hb_all_books_dl.js
Humble bundle book bundles - download all books at once
View hb_all_books_dl.js
After purchasing a humble book bundle, go to your download page for that bundle.
Open a console window for the page and paste in the below javascript
Updated: Credit @jmerle
const commands = [];
document.querySelectorAll('.row').forEach(row => {
const bookTitle = row.dataset.humanName;
stanzheng /
Created Jul 18, 2018
Make Self Signed Cert
# openssl genrsa -des3 -out 2048
openssl genrsa -des3 -out ${HOSTNAME}.key 2048
# Fill in Cert info basics
openssl req -new -key ${HOSTNAME}.key -out ${HOSTNAME}.csr
openssl x509 -req -days 365 -in ${HOSTNAME}.csr -signkey ${HOSTNAME}.key -out ${HOSTNAME}.crt
stanzheng /
Created Jun 26, 2018
docker volume backup
#docker volume backup
docker run -v jenkins_new_jenkins:/volume -v /tmp:/backup --rm loomchild/volume-backup backup jenkins_archive
docker run -v jenkins_home:/volume -v /tmp:/backup --rm loomchild/volume-backup restore jenkins_archive
docker run --name new-jenkins -p 8082:8080 -p 5000:50000 --mount source=jenkins_home,target=/var/jenkins_home
View Serverless_deploy.json
"Version": "2012-10-17",
"Statement": [
"Sid": "VisualEditor0",
"Effect": "Allow",
"Action": [
stanzheng /
Last active Feb 7, 2019
postgres examples from
You can’t perform that action at this time.