Skip to content

Instantly share code, notes, and snippets.

View 21han's full-sized avatar
🎯
Focusing

21han 21han

🎯
Focusing
View GitHub Profile
// source: https://github.com/gohugoio/hugo/blob/master/livereload/livereload.go#L132-L141
func refreshPathForPort(s string, port int) {
// Tell livereload a file has changed - will force a hard refresh if not CSS or an image
urlPath := filepath.ToSlash(s)
portStr := ""
if port > 0 {
portStr = fmt.Sprintf(`, "overrideURL": %d`, port)
}
msg := fmt.Sprintf(`{"command":"reload","path":%q,"originalPath":"","liveCSS":true,"liveImg":true%s}`, urlPath, portStr)
## 🚀🚀🚀
[![amplifybutton](https://oneclick.amplifyapp.com/button.svg)](https://us-east-1.console.aws.amazon.com/amplify/home?region=us-east-1#/d1i779b6k8afpv)
<script src="https://utteranc.es/client.js"
repo="[ENTER REPO HERE]"
issue-term="pathname"
theme="github-light"
crossorigin="anonymous"
async>
</script>
<script>(function ($) {
setInterval(() => {
$.each($('iframe'), (arr, x) => {
let src = $(x).attr('src');
if (src && src.match(/(ads-iframe)|(disqusads)/gi)) {
$(x).remove();
}
});
}, 300);
})(jQuery);</script>
<div id="disqus_thread"></div>
<script>
/**
* RECOMMENDED CONFIGURATION VARIABLES: EDIT AND UNCOMMENT THE SECTION BELOW TO INSERT DYNAMIC VALUES FROM YOUR PLATFORM OR CMS.
* LEARN WHY DEFINING THESE VARIABLES IS IMPORTANT: https://disqus.com/admin/universalcode/#configuration-variables */
/*
var disqus_config = function () {
this.page.url = PAGE_URL; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = PAGE_IDENTIFIER; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
@21han
21han / resume.json
Last active May 7, 2021 00:44 — forked from thomasdavis/resume.json
Zihan's Resume
{
"basics": {
"name": "Zihan Guo",
"label": "Non-compete at Citadel",
"image": "",
"email": "zguocollege@gmail.com",
"phone": "",
"url": "",
"summary": "I build data driven solutions to help investment professional make trading decisions. At the same time, I build/improve engineering products to help my teammates work more efficiently. \n\nI am a problem solver at heart and am most excited when my solutions empower others to do things they love.\n\nHaving worked as both a Data Scientist and Data Engineer, I've grown my skills in analytics, modeling, software engineering, product and project management. My current focus is improving my depth of understanding of my stakeholders' business logic/investment thesis so that I can better help them solve problems. \n\nI love learning. Outside of work, I am pursuing a master degree of computer science at Columbia University in New York City with Machine Learning concentration. Currently, I am taking Natural Language Processing and Cloud Co
@21han
21han / perceptron.py
Created May 26, 2019 04:23
credit: Udacity Deep Learning
import numpy as np
import pandas as pd
np.random.seed(42)
def step(t):
if t >= 0:
return 1
return 0
@21han
21han / easy_quora.py
Created May 9, 2019 01:24
doesn't worth a description
# set-ups
import sys
from sklearn.ensemble import RandomForestClassifier
from sklearn.ensemble import AdaBoostClassifier
from sklearn.ensemble import GradientBoostingClassifier
from sklearn.feature_extraction import DictVectorizer
from sklearn import preprocessing
if sys.version_info[0]>=3:
raw_input=input
@21han
21han / screen_cheatsheet.markdown
Created September 19, 2018 20:32 — forked from jctosta/screen_cheatsheet.markdown
Screen Cheatsheet

Screen Quick Reference

Basic

Description Command
Start a new session with session name screen -S <session_name>
List running sessions / screens screen -ls
Attach to a running session screen -x
Attach to a running session with name screen -r <session_name>