Skip to content

Instantly share code, notes, and snippets.

Avatar

Sanhe Hu MacHu-GWU

  • Amazon Web Service Data Lab
  • Maryland, USA
View GitHub Profile
@MacHu-GWU
MacHu-GWU / Bash.sublime-settings
Last active Jul 21, 2021
Sublime text settings sync
View Bash.sublime-settings
// These settings override both User and Default settings for the Bash syntax
{
"translate_tabs_to_spaces": true
}
View Senior Data Engineer.rst

Senior Data Engineer

Job Description

@MacHu-GWU
MacHu-GWU / display_ghost_resource.py
Created Sep 26, 2019
Display Running AWS Resource to avoid been over charged
View display_ghost_resource.py
#!/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 Oct 18, 2018
Google Sheet to pandas.DataFrame
View gspread_pandas_example.py
# -*- 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 Sep 11, 2018
an example of using custom style in restructured text.
View CSS-Style-In-RestructuredText.rst
.. role:: red
:class: red
.. role:: blue
:class: blue
.. role:: green
:class: green
.. raw:: html
@MacHu-GWU
MacHu-GWU / backup-mongodb.sh
Created Nov 5, 2017
A bash script backup your mongodb data and store archive to AWS S3.
View backup-mongodb.sh
#!/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 Aug 22, 2017
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View PyCharm-Shortcuts-and-Keymap.rst