Skip to content

Instantly share code, notes, and snippets.

View phouse512's full-sized avatar

Philip House phouse512

View GitHub Profile
@phouse512
phouse512 / main.tf
Created May 2, 2021 22:58
static site deployment with AWS
terraform {
required_providers {
aws = {
source = "hashicorp/aws"
version = "3.19.0"
}
}
}
provider "aws" {
# python3 test
import unittest
class TestFuncEquality(unittest.TestCase):
def test_all(self) -> None:
self.assertDictEqual({}, {})
self.assertMultiLineEqual("", "")
self.assertTupleEqual((2, 2), (2, 2))
self.assertSetEqual(set([3]), set([3]))
# python3 test assertListEquals stub.
from unittest import TestCase
from typing import List
class MyTest(TestCase):
def test_assert_list(self) -> None:
list1 = list() # type: List[None]
list2 = list() # type: List[None]
self.assertListEqual(list1, list2)
@phouse512
phouse512 / 0_reuse_code.js
Created November 18, 2015 17:35
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@phouse512
phouse512 / nginxproxy.md
Created November 12, 2015 04:37 — forked from soheilhy/nginxproxy.md
How to proxy web apps using nginx?

Virtual Hosts on nginx (CSC309)

When hosting our web applications, we often have one public IP address (i.e., an IP address visible to the outside world) using which we want to host multiple web apps. For example, one may wants to host three different web apps respectively for example1.com, example2.com, and example1.com/images on the same machine using a single IP address.

How can we do that? Well, the good news is Internet browsers

#!/bin/bash
# run if user hits control-c
control_c()
{
echo "Oh no, exiting!"
for pid in $(cat gunicorn.pid)
do
echo "killing $pid"
kill -SIGKILL $pid
done