Skip to content

Instantly share code, notes, and snippets.

View szy0syz's full-sized avatar
🐽
busy

Zhenyu Shi szy0syz

🐽
busy
View GitHub Profile
Please go to https://github.com/nishuzumi/gemini-teacher
@craigtp
craigtp / AdvancedDistributedSystemDesignCourseNotes.md
Created May 1, 2020 19:38
Notes on Udi Dahan's Advanced Distributed System Design Course

Advanced Distributed System Design Course - Udi Dahan

Notes by Craig Phillips

Fallacies of Distributed Computing

  • There are 11 fallacies of Distributed Computing:
    1. The network is reliable
    2. Latency isn’t a problem
    3. Bandwidth isn’t a problem
    4. The network is secure
  1. The topology won’t change
npm set registry https://r.npm.taobao.org # ζ³¨ε†Œζ¨‘ε—ι•œεƒ
npm set disturl https://npm.taobao.org/dist # node-gyp ηΌ–θ―‘δΎθ΅–ηš„ node ζΊη ι•œεƒ
## δ»₯δΈ‹ι€‰ζ‹©ζ·»εŠ 
npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass # node-sass δΊŒθΏ›εˆΆεŒ…ι•œεƒ
npm set electron_mirror https://npm.taobao.org/mirrors/electron/ # electron δΊŒθΏ›εˆΆεŒ…ι•œεƒ
npm set puppeteer_download_host https://npm.taobao.org/mirrors # puppeteer δΊŒθΏ›εˆΆεŒ…ι•œεƒ
npm set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver # chromedriver δΊŒθΏ›εˆΆεŒ…ι•œεƒ
npm set operadriver_cdnurl https://npm.taobao.org/mirrors/operadriver # operadriver δΊŒθΏ›εˆΆεŒ…ι•œεƒ
npm set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs # phantomjs δΊŒθΏ›εˆΆεŒ…ι•œεƒ
@chendo
chendo / _document.js
Last active June 2, 2022 02:54
Server side rendering (SSR) in Next.js with styled-components, styled-jsx, and emotion.
import Document, { Head, Main, NextScript } from 'next/document'
import { renderToString } from 'react-dom/server'
import { extractCritical } from 'emotion-server'
import { ServerStyleSheet } from 'styled-components'
import flush from 'styled-jsx/server'
export default class MyDocument extends Document {
static async getInitialProps(ctx) {
const styledComponentsSheet = new ServerStyleSheet()
PHP 10 hrs 33 mins β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 64.0%
TypeScript 2 hrs 7 mins β–ˆβ–ˆβ–‹β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 12.9%
Smarty 2 hrs 5 mins β–ˆβ–ˆβ–‹β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 12.7%
Nginx 25 mins β–Œβ–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘β–‘ 2.5%
JavaScript 20 mins ▍░░░░░░░░░░░░░░░░░░░░ 2.0%
@yevrah
yevrah / nodejs-cheatsheet.js
Created March 14, 2019 05:52 — forked from LeCoupa/nodejs-cheatsheet.js
Complete Node.js CheatSheet --> UPDATED VERSION --> https://github.com/LeCoupa/awesome-cheatsheets
/* *******************************************************************************************
* THE UPDATED VERSION IS AVAILABLE AT
* https://github.com/LeCoupa/awesome-cheatsheets
* ******************************************************************************************* */
// 0. Synopsis.
// http://nodejs.org/api/synopsis.html
@bradtraversy
bradtraversy / docker_wordpress.md
Last active October 8, 2025 11:15
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
@weihanglo
weihanglo / rust-vs-go.md
Last active July 11, 2025 13:11
【譯】Rust vs. Go

【譯】Rust vs. Go

ζœ¬ζ–‡θ­―θ‡ͺ Julio Merino 2018 εΉ΄δΈƒζœˆζ’°ε―«ηš„ Rust vs. Go 一文。Julio Merino 是 G η€Ύεƒ±ε“‘οΌŒεœ¨ G η€Ύε·₯δ½œθΆ…ιŽ 8 εΉ΄οΌŒη„‘θ«–ε·₯δ½œε…§ε€–οΌŒιƒ½ζŽ₯觸開發不少 Go θͺžθ¨€οΌŒδΈ¦ζ’°ε―« [Rust ι»žθ©•][rust-review]η³»εˆ—ζ–‡οΌŒδΎ†θ½θ½δ»–ε° Rust θˆ‡ Go ηš„ζƒ³ζ³•ε§γ€‚

Thanks Julio Merino for this awesome article!


@yevrah
yevrah / Upgrade vim
Last active February 25, 2025 22:09
Update to Vim8 on Centos 7
################################################################################
# Method 1: Install using rpm packages (credit to DarkMukke)
#
rpm -Uvh http://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el7.noarch.rpm
rpm --import http://mirror.ghettoforge.org/distributions/gf/RPM-GPG-KEY-gf.el7
# WARNING: removing vim-minimal uninstalls `sudo` if you skip the second step
# make sure to at least run `yum install sudo`
yum -y remove vim-minimal vim-common vim-enhanced
@oliveratgithub
oliveratgithub / emojis.json
Last active October 17, 2025 07:04
Emoji-list with emojis, names, shortcodes, unicode and html entities [massive list]
{
"emojis": [
{"emoji": "πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘§", "name": "family: woman, woman, girl, girl", "shortname": ":woman_woman_girl_girl:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F467", "html": "👩‍👩‍👧‍👧", "category": "People & Body (family)", "order": ""},
{"emoji": "πŸ‘©β€πŸ‘©β€πŸ‘§β€πŸ‘¦", "name": "family: woman, woman, girl, boy", "shortname": ":woman_woman_girl_boy:", "unicode": "1F469 200D 1F469 200D 1F467 200D 1F466", "html": "👩‍👩‍👧‍👦", "category": "People & Body (family)", "order": ""},
{"emoji": "πŸ‘©β€πŸ‘©β€πŸ‘¦β€πŸ‘¦", "name": "family: woman, woman, boy, boy", "shortname": ":woman_woman_boy_boy:", "unicode": "1F469 200D 1F469 200D 1F466 200D 1F466", "html": "👩‍👩‍👦‍👦", "category": "People & Body (family)", "order": ""},
{"emoji": "πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘§", "name": "family: man, woman, girl, girl", "shortname": ":man_woman_girl_girl:", "unicode": "1F468 200D 1F469 200D 1F467 200D 1F467", "html": "👨‍👩&z