Skip to content

Instantly share code, notes, and snippets.

View MacHu-GWU's full-sized avatar

Sanhe Hu MacHu-GWU

  • Amazon Web Service Data Lab
  • Maryland, USA
View GitHub Profile
@MacHu-GWU
MacHu-GWU / inspect_mate.py
Created May 9, 2017 20:34
``inspect_mate`` provides more methods to get information about class attribute than the standard library ``inspect``.
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
``inspect_mate`` provides more methods to get information about class attribute
than the standard library ``inspect``.
This module is Python2/3 compatible, tested under Py2.7, 3.3, 3.4, 3.5, 3.6.
Includes tester function to check:
@MacHu-GWU
MacHu-GWU / Bash.sublime-settings
Last active July 21, 2021 01:26
Sublime text settings sync
// These settings override both User and Default settings for the Bash syntax
{
"translate_tabs_to_spaces": true
}
@MacHu-GWU
MacHu-GWU / Senior Data Engineer.rst
Created December 6, 2019 16:36
Interview Engineers

Senior Data Engineer

Job Description

@MacHu-GWU
MacHu-GWU / display_ghost_resource.py
Created September 26, 2019 20:59
Display Running AWS Resource to avoid been over charged
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Display running AWS Resource associate by Search Keyword.
- EC2: check all tag values
- Sagemake Notebook: check notebook name and all tag values
- RDS: check db identifier and all tag values
"""
@MacHu-GWU
MacHu-GWU / gspread_pandas_example.py
Created October 18, 2018 22:05
Google Sheet to pandas.DataFrame
# -*- coding: utf-8 -*-
"""
- Pip install this: https://github.com/aiguofer/gspread-pandas
- Follow this to setup your Google API credential: https://github.com/aiguofer/gspread-pandas#client-credentials
- Finally you put your credential.json file at ``~/.config/gspread_pandas/google_secret.json``
"""
from gspread_pandas import Spread
@MacHu-GWU
MacHu-GWU / CSS-Style-In-RestructuredText.rst
Last active September 11, 2018 17:25
an example of using custom style in restructured text.
.. role:: red
:class: red
.. role:: blue
:class: blue
.. role:: green
:class: green
.. raw:: html
@MacHu-GWU
MacHu-GWU / Awesome Machine Learning Article.rst
Created March 30, 2018 18:35
Awesome Machine Learning Article
@MacHu-GWU
MacHu-GWU / backup-mongodb.sh
Created November 5, 2017 02:56
A bash script backup your mongodb data and store archive to AWS S3.
#!/usr/bin/env bash
DATABASE="Database name here"
HOST="Host here"
PORT=27017
USERNAME="username"
PASSWORD="password"
BUCKET_NAME="www.wbh-doc.com"
STORAGE_PREFIX="FileHost/MongoBackup" # No Slash at Begin and End!
@MacHu-GWU
MacHu-GWU / 0_reuse_code.js
Created August 22, 2017 00:10
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