Skip to content

Instantly share code, notes, and snippets.

View CyrusYip's full-sized avatar
:octocat:
Learning

Cyrus Yip CyrusYip

:octocat:
Learning
View GitHub Profile
@CyrusYip
CyrusYip / hosts
Last active July 5, 2023 15:49
屏蔽运营商流量本机号码一键登录
# 屏蔽运营商流量本机号码一键登录
# 来源:https://bbs.letitfly.me/d/1213
# 中国移动
0.0.0.0 config.cmpassport.com
0.0.0.0 www.cmpassport.com
0.0.0.0 wap.cmpassport.com
0.0.0.0 onekey1.cmpassport.com
0.0.0.0 log1.cmpassport.com
0.0.0.0 smsks1.cmpassport.com
@CyrusYip
CyrusYip / colors.py
Created July 16, 2022 06:03 — forked from lilydjwg/colors.py
colors.py: show all kinds of terminal colors at a glance
#!/usr/bin/python3
from functools import partial
def colors16():
for bold in [0, 1]:
for i in range(30, 38):
for j in range(40, 48):
print(f'\x1b[{bold};{i};{j}m {bold};{i};{j} |\x1b[0m', end='')
print()
@CyrusYip
CyrusYip / emmetAdditionalHTML.md
Created June 29, 2021 10:15 — forked from AnalogGhost/emmetAdditionalHTML.md
Additional HTML Shortcuts with Emmet

Emmet - Additional HTML Shortcuts

Script with Source

script:src
@CyrusYip
CyrusYip / multiple_ssh_setting.md
Created June 16, 2021 09:14 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@CyrusYip
CyrusYip / cssreset.css
Created June 13, 2021 13:32 — forked from FrankFang/cssreset.css
css reset
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
*::before,
*::after {
box-sizing: border-box;
}
a {
@CyrusYip
CyrusYip / _Google Analytics 4 with Hugo.md
Created March 27, 2021 02:22 — forked from zjeaton/_Google Analytics 4 with Hugo.md
Google Analytics 4 (with Measurement ID) in Hugo

Google Analytics 4 in Hugo

Blog post with slightly more detail can be found here. If you want to just get to it, read on.

I (very) recently decided to reimplement GA in my site, and found that existing implementation in Hugo was not compatible with GA4's new Measurement ID. This is an easy way to drop your Measurement ID into your site. I'm not going to go into how to sign up for GA.

This implementation requires that you create a site parameter for analytics, create a partial, and call the partial. I tweaked the names of the parameters and files so they didn't collide with the built-in hugo code.

Place the GoogleAnalyicsID (Measurement ID) in config.toml within [params].

Use Proxy for Git/GitHub

Generally, the Git proxy configuration depends on the Git Server Protocal you use. And there're two common protocals: SSH and HTTP/HTTPS. Both require a proxy setup already. In the following, I assume a SOCKS5 proxy set up on localhost:1080. But it can also be a HTTP proxy. I'll talk about how to set up a SOCKS5 proxy later.

SSH Protocol

When you do git clone ssh://[user@]server/project.git or git clone [user@]server:project.git, you're using the SSH protocal. You need to configurate your SSH client to use a proxy. Add the following to your SSH config file, say ~/.ssh/config:

ProxyCommand nc -x localhost:1080 %h %p
@CyrusYip
CyrusYip / latex.template
Created October 19, 2020 06:23 — forked from michaelt/latex.template
Simple Pandoc default.latex with comments
%!TEX TS-program = xelatex
\documentclass[12pt]{scrartcl}
% The declaration of the document class:
% The second line here, i.e.
% \documentclass[12pt]{scrartcl}
% is a standard LaTeX document class declaration:
% we say what kind of document we are making in curly brackets,
% and specify any options in square brackets.