Skip to content

Instantly share code, notes, and snippets.

View Andrew-Chen-Wang's full-sized avatar
🐢
herro

Andrew Chen Wang Andrew-Chen-Wang

🐢
herro
View GitHub Profile
@Andrew-Chen-Wang
Andrew-Chen-Wang / EKSvsEC2.md
Created February 7, 2023 20:10 — forked from mbstacy/EKSvsEC2.md
EKS vs EC2 Kubernetes Costs

Kubernetes Cost Comparison EC2 vs EKS

EKS Kubernetes

AWS EKS service provides the Kubernetes control plane. Price for EKS Service is $0.20 per hour / cluster.

EKS Use Case Monthly Cost

Three clusters with four worker nodes.

@Andrew-Chen-Wang
Andrew-Chen-Wang / install.sh
Created November 4, 2022 10:38
Installing Docker on Ubuntu
sudo apt-get update -y
sudo apt-get install -y \
ca-certificates \
curl \
gnupg \
lsb-release
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
@Andrew-Chen-Wang
Andrew-Chen-Wang / ViewController.swift
Created June 12, 2022 05:48
Upload presigned post image to AWS S3
// Full demo found in https://github.com/Andrew-Chen-Wang/ios-django-picture-upload
//
// ViewController.swift
// jwt-ios
//
// Created by Andrew Chen Wang on 3/2/20.
// Copyright © 2020 Andrew Chen Wang. All rights reserved.
//
@Andrew-Chen-Wang
Andrew-Chen-Wang / labor-law-scraper.py
Last active May 21, 2022 05:47
Download labor law posters required for sending to employees
#
# Copyright 2022 Andrew Chen Wang, Ur LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
@Andrew-Chen-Wang
Andrew-Chen-Wang / TOP_SUBREDDITS
Last active September 25, 2022 16:34
Top subreddits from redditlist.com
['announcements', 'funny', 'AskReddit', 'gaming', 'aww', 'Music', 'pics', 'worldnews', 'science', 'movies', 'todayilearned', 'videos', 'news', 'Showerthoughts', 'Jokes', 'food', 'askscience', 'IAmA', 'EarthPorn', 'gifs', 'nottheonion', 'books', 'DIY', 'explainlikeimfive', 'LifeProTips', 'Art', 'space', 'sports', 'mildlyinteresting', 'Documentaries', 'gadgets', 'tifu', 'memes', 'photoshopbattles', 'UpliftingNews', 'GetMotivated', 'dataisbeautiful', 'listentothis', 'history', 'television', 'philosophy', 'InternetIsBeautiful', 'Futurology', 'WritingPrompts', 'OldSchoolCool', 'personalfinance', 'nosleep', 'creepy', 'TwoXChromosomes', 'wallstreetbets', 'technology', 'wholesomememes', 'AdviceAnimals', 'interestingasfuck', 'Fitness', 'politics', 'WTF', 'lifehacks', 'oddlysatisfying', 'relationship_advice', 'Minecraft', 'travel', 'NatureIsFuckingLit', 'facepalm', 'Whatcouldgowrong', 'pcmasterrace', 'nextfuckinglevel', 'leagueoflegends', 'BlackPeopleTwitter', 'me_irl', 'bestof', 'dankmemes', 'Unexpected', 'Tinder', 'd
@Andrew-Chen-Wang
Andrew-Chen-Wang / README.md
Last active December 3, 2021 17:53
Understanding NFTs for Babies like Me

WTF is an NFT and why are they so expensive?

Understanding NFTs for Babies like Me

By: Andrew-Chen-Wang

Written on 2021-12-03


@Andrew-Chen-Wang
Andrew-Chen-Wang / bot.js
Created October 14, 2021 21:04
Save Plate shouter for ICC Houses
let spreadsheet = "Today's Save Plates"
function capitalizeFirstLetter(string) {
return string.charAt(0).toUpperCase() + string.slice(1);
}
function increment_char(c) {
return c !== 'Z' ? String.fromCharCode(c.charCodeAt(0) + 1) : 'A';
}
@Andrew-Chen-Wang
Andrew-Chen-Wang / Excel-karabiner.md
Last active August 22, 2024 00:56
Using Karabiner to let me press CMD+Return/Enter/Shift to edit cells in MacOS Excel 2016+

Shortcuts that I overrode for Excel:

  • Editing a cell is now CMD + Return/Enter/Shift (used to be Option + U or F2)

Setup:

  1. Install Karabiner-Elements
  2. Set everything up properly
  3. Go to your terminal and run cd ~/.config/karabiner/assets/complex_modifications && touch excel.json
  4. Copy and paste everything from the json content below into excel.json
  5. Go to Karabiner-Elements > Complex Modifications > Import Rule then enable the Excel rule thingy
@Andrew-Chen-Wang
Andrew-Chen-Wang / apps.py
Created November 24, 2020 07:39
Django-ratelimit behind a reverse proxy without changing ip key
"""
I've had to monkeypatch django-ratelimit due to slow development.
The patch is basically allowing Django Axes with Django ipware
to grab the IP address rather than taking the IP straight from
META attribute in the request object.
You can find an initial implementation here:
https://github.com/jsocol/django-ratelimit/pull/208
but the PR lead no where due to just not knowing how
@Andrew-Chen-Wang
Andrew-Chen-Wang / main.py
Last active November 13, 2020 00:24
Checks if a binary, square matrix is in partial order
# Henceforth arr
a = [
[1,1,1,1],
[1,1,1,1],
[1,1,1,1],
[1,1,1,1]
]
def find_ones(arr):
b = []