Skip to content

Instantly share code, notes, and snippets.

View emsesc's full-sized avatar
:shipit:

Emily Chen emsesc

:shipit:
View GitHub Profile
const querystring = require('querystring');
const CosmosClient = require("@azure/cosmos").CosmosClient;
var multipart = require("parse-multipart");
var fetch = require("node-fetch");
const accountSid = "***";
const authToken = "***";
const client = require('twilio')(accountSid, authToken);
// https://www.twilio.com/docs/voice/quickstart/node
@emsesc
emsesc / commands.md
Last active July 5, 2021 19:13
Commands to update your course!
git checkout main
git pull origin main
git add .
git commit -m "Update progress"
git push origin main
git remote add upstream https://github.com/bitprj/intro-to-serverless
git fetch upstream main
git merge -X theirs --allow-unrelated-histories --squash upstream/main
git add .
@emsesc
emsesc / twocatz-frontend.yml
Last active July 16, 2021 20:57
Copy paste this file and commit it to your .github/workflows/twocatz-frontend.yml file on the twocatz-frontend branch. Completely replace the content with this!
name: twoCatz Frontend
on:
push:
branches:
- twocatz-frontend
jobs:
build:
runs-on: ubuntu-latest
@emsesc
emsesc / deploy.md
Created August 16, 2021 21:22
Deploy tinyhats on K8s

You should save the access key ID and secret access key in a file named ~/.aws/credentials as follows:

[default]
aws_access_key_id=[access-key-id]
aws_secret_access_key=[secret-access-key]

Make sure you have kubectl and eksctl installed before you proceed

Next, create the cluster. Note: This may take awhile, so sit tight!

@emsesc
emsesc / minikube.md
Last active September 18, 2021 17:50
Minikube Deployment

Download minikube

Follow instructions here to install minikube.

Deploy Cluster

minikube start

(For now download file from here, we can add wget command later).

unzip minikube.zip
@emsesc
emsesc / tinyhat.sql
Last active September 25, 2021 01:40
Commands to add a hat with a style of "cat-ears" to your TinyHat.Me instance.
CREATE TABLE IF NOT EXISTS images(id int NOT NULL AUTO_INCREMENT, keyId varchar(30), base64 LONGTEXT, fileName varchar(255), description varchar(255), approve varchar(30), PRIMARY KEY(id));
INSERT INTO images VALUES (1, 's7xvjkdunfbeuae2', 'iVBORw0KGgoAAAANSUhEUgAAAaQAAAGkCAYAAAB+TFE1AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAGLLSURBVHhe7Z0HlFzHdaZtyXtWokASwAxAIgciZwwySWQQzAGRAEEwk4LEnHMGGACSyAAJBsnrcyxLtmzJsmxlU7K1smXZVqJtiZaYIwAmievVWjq196t5d/jwpnqmJ2J65v/Ouaenu9/09Ly6df+qW/fV+z0hhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEIIIYQQQgghhBBCCCGEEEI
@emsesc
emsesc / challenges.md
Created October 16, 2021 15:15
Week 2 Crypto Challenges

Crypto Challenges

Intro

🙁🙂🙂🙁🙂🙁🙁🙁 🙁🙁🙂🙂🙁🙁🙁🙂 🙁🙂🙂🙁🙁🙂🙁🙁 🙁🙁🙂🙂🙁🙁🙁🙂 🙁🙂🙂🙁🙂🙂🙂🙁 🙁🙂🙂🙁🙁🙂🙂🙂 🙁🙂🙁🙂🙂🙂🙂🙂 🙁🙂🙂🙁🙁🙁🙂🙁 🙁🙁🙂🙂🙁🙁🙂🙂 🙁🙂🙂🙁🙂🙁🙁🙁 🙁🙁🙂🙂🙁🙁🙁🙂 🙁🙂🙂🙁🙂🙂🙂🙁 🙁🙂🙂🙁🙁🙂🙁🙁 🙁🙂🙁🙂🙂🙂🙂🙂 🙁🙂🙂🙁🙁🙂🙂🙁 🙁🙁🙂🙂🙁🙂🙁🙁 🙁🙂🙂🙁🙁🙁🙂🙂 🙁🙁🙂🙂🙁🙁🙂🙂 🙁🙂🙂🙂🙁🙁🙂🙂

Advanced

/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAMCAgICAgMCAgIDAwMDBAYEBAQEBAgGBgUGCQgKCgkICQkKDA8MCgsOCwkJDRENDg8QEBEQCgwSExIQEw8QEBD/2wBDAQMDAwQDBAgEBAgQCwkLEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBD/wgARCAGwAkEDASIAAhEBAxEB/8QAHQAAAgIDAQEBAAAAAAAAAAAABAUDBgACBwEICf/EABoBAAMBAQEBAAAAAAAAAAAAAAABAgMEBQb/2gAMAwEAAhADEAAAAaKswXlrxI3WWtDUDli/Z1XqRERRCGEVqkzK+ajbIfloYJHM1V8Z2mrVqxY7dBSqyI05BdKNXOrLsPafm/q2GvRmNZb83SjiRRa4M1uQWtdo4ECcQ7Rxbpxzz33qzIlFMh9is9IsPNuQ6q8+bsEKEONWI6Yho8QrzSAu28U6VlTuOEPB1tlU7dQj5x1MehSH02oTa45t0as+W3a2D5CnmvT1EjViwFST816fTHoY7XMYdjyLNY+SRGk/dy1pbZIqmsQOFOicIZ9KFjNZIFozzIXnQeeWmBvW2iZAHmetmWulGKrPa+dOy9+L/Q3DrixdP5F1DLe2H1Jxy7SKp01ovF81TPEGNS9451vkO+O3mZ0ZTziGJ9GstLsnPtPKrmk8g8lV63ZP0Edc0q4Up9daXb4pyvKByVfaBsZbPavi6DSpm0RV0PK6W8975RLZFE8K67xMf0RJAXlso570Hn
@emsesc
emsesc / twitter_handles.py
Last active December 3, 2022 22:23
Reads web sources from "input.csv" and outputs websites with corresponding Twitter handles.
import csv
import urllib.request
import re
import time
rows = []
# regex function (finds twitter handle)
def getHandle(pattern, html):
result = re.findall(pattern, html)
return result[0][1]
@emsesc
emsesc / output.md
Last active February 10, 2023 20:43
Output of YouTube API

Python Script

from youtube_api import YouTubeDataAPI

# Set the API key
API_KEY=""

yt = YouTubeDataAPI(API_KEY)

# Channel IDs
import json
def lambda_handler(event, context):
# Get the RGB value from the event object (parameter)
rgb = event["queryStringParameters"]["rgb"]
# Split the RGB value into separate red, green, and blue values
split_rgb = rgb.split(',')
# Access each hex value by indexes