Skip to content

Instantly share code, notes, and snippets.

View ericcgu's full-sized avatar
🏠
Working remotely

Eric Gu (@ericguuu) ericcgu

🏠
Working remotely
  • New York, NY
View GitHub Profile
alias k=kubectl
Namespace
Pods
Commands
- must be in array brackets
- CMD overrides ENTRYPOINT
- ARGS overides CMD
@ericcgu
ericcgu / gist:6de73b6f4014df04e28762d6d896f061
Last active May 25, 2019 05:45
Apache 2.4 CORS httpd.conf
1. Load Modules
```
LoadModule headers_module modules/mod_headers.so
LoadModule rewrite_module modules/mod_rewrite.so
```
2. Change Folder in Bold to your target directory serving the endpoint:
```
<Directory "**/usr/local/apache2**">
AllowOverride None
Require all granted
TCP / IP Model (OLD) : Application , Transport , Internet, Link
TCP / IP Model (NEW) : Application , Transport , Internet, Data Link, Physical
hemplab-casino1-dev
export http_proxy=http://server.proxy.vzwcorp.com:9290
export https_proxy=http://server.proxy.vzwcorp.com:9290
export no_proxy=.verizon.com
sudo yum update -y
yum install nano -y
yum install epel-release -y
yum groupinstall 'Development Tools'
yum install python-pip -y
@ericcgu
ericcgu / userauth.py
Last active May 30, 2019 15:21
flask-dance google oauth2.0
from flask import Blueprint, redirect, url_for, session
from flask_dance.contrib.google import make_google_blueprint, google
from flask_dance.consumer.backend.sqla import SQLAlchemyBackend
from flask_login import current_user, login_user, logout_user
from flask_dance.consumer import oauth_authorized
from sqlalchemy.orm.exc import NoResultFound
from oauthlib.oauth2.rfc6749.errors import InvalidClientIdError
from itemcatalog import app, db, user
userauth = Blueprint('userauth', __name__)
@ericcgu
ericcgu / .eslintrc
Created September 11, 2018 14:14 — forked from elijahmanor/.eslintrc
Add Prettier & ESLint to VS Code with a Create React App
{
"extends": ["react-app", "plugin:prettier/recommended"]
}
# HelloWorld_Fortran test
# start by building the basic container
FROM centos:latest
MAINTAINER Eric Gu
RUN yum update -y
# add gfortran, debugging tools and make
RUN yum install -y gcc-gfortran gdb make
# build the hello world code
@ericcgu
ericcgu / adj_matrix.py
Created July 12, 2018 16:22
Adjacency Matrix
class Vertex:
def __init__(self, vertex):
self.name = vertex
self.neighbors = []
def add_neighbor(self, neighbor):
if isinstance(neighbor, Vertex):
if neighbor.name not in self.neighbors:
self.neighbors.append(neighbor.name)
neighbor.neighbors.append(self.name)
@ericcgu
ericcgu / graphUndirected.ipynb
Created July 12, 2018 16:21 — forked from anirudhjayaraman/graphUndirected.ipynb
Python Implementation of Undirected Graphs (Adjacency List and Adjacency Matrix)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ericcgu
ericcgu / README.md
Created July 10, 2018 01:01 — forked from jxson/README.md
README.md template

Synopsis

At the top of the file there should be a short introduction and/ or overview that explains what the project is. This description should match descriptions added for package managers (Gemspec, package.json, etc.)

Code Example

Show what the library does as concisely as possible, developers should be able to figure out how your project solves their problem by looking at the code example. Make sure the API you are showing off is obvious, and that your code is short and concise.

Motivation