Skip to content

Instantly share code, notes, and snippets.

View chi-feng's full-sized avatar

Chi Feng chi-feng

View GitHub Profile
@chi-feng
chi-feng / 人类误判心理学.md
Created November 30, 2023 02:07
人类误判心理学 Charles T. Munger

人类误判心理学

作者:Charles T. Munger

我长期以来对标准思维错误非常感兴趣。

然而,我受的教育是在一个时代,那时候非病人治疗心理学对于理解误判的贡献在主流精英中几乎得不到承认。相反,对心理学的兴趣主要限于一群教授们,他们几乎只是为了自己而进行讨论和发表文章,但往往因为孤立和团体思维而受到很大的自然损害。

因此,在我在Caltech和哈佛法学院学习之后,我对心理学一无所知。那些机构并没有要求对这个学科的了解。当然,当他们自己不了解心理学时,他们无法将心理学与他们的其他学科融合。另外,就像尼采笔下那个以他的瘸腿为荣的人物一样,这些机构也以他们故意回避“模糊”的心理学和心理学教授为荣。

@chi-feng
chi-feng / The Psychology of Human Misjudgment.md
Created November 30, 2023 01:58
Munger - The Psychology of Human Misjudgment

The Psychology of Human Misjudgment

By Charles T. Munger

I have long been very interested in standard thinking errors.

However, I was educated in an era wherein the contributions of non-patient-treating psychology to an understanding of misjudgment met little approval from members of the mainstream elite. Instead, interest in psychology was pretty well confined to a group of professors who talked and published mostly for themselves, with much natural detriment from isolation and groupthink.

And so, right after my time at Caltech and Harvard Law School, I possessed a vast ignorance of psychology. Those institutions failed to require knowledge of the subject. And, of course, they couldn't integrate psychology with their other subject matter when they didn't know psychology. Also, like the Nietzsche character who was proud of his lame leg, the institutions were proud of their willful avoidance of "fuzzy" psychology and "fuzzy" psychology professors.

@chi-feng
chi-feng / install_node.sh
Last active December 14, 2023 00:35
Install node v18
#!/bin/bash
# Download and import the Nodesource GPG key
sudo apt-get update
sudo apt-get install -y ca-certificates curl gnupg
sudo mkdir -p /etc/apt/keyrings
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | sudo gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg
# Create deb repository
NODE_MAJOR=18
@chi-feng
chi-feng / install_docker.sh
Created August 21, 2023 17:11
Install docker
#!/bin/bash
sudo apt-get update
sudo apt-get -y install ca-certificates curl gnupg
sudo install -m 0755 -d /etc/apt/keyrings
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
sudo chmod a+r /etc/apt/keyrings/docker.gpg
echo \
"deb [arch="$(dpkg --print-architecture)" signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
"$(. /etc/os-release && echo "$VERSION_CODENAME")" stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
@chi-feng
chi-feng / arxiv_prepare.sh
Created May 10, 2023 01:52
prepare latex project for arxiv
#!/bin/bash
# use \listfiles in preamble to get a list of included files
rm -rf arxiv_tmp
mkdir -p arxiv_tmp
# copy files to temp folder
rsync -av --files-from=list-of-files.txt . arxiv_tmp/
@chi-feng
chi-feng / fastapi-celery.md
Last active July 18, 2022 21:08
Asynchronous Tasks with FastAPI and Celery
sequenceDiagram
    participant Client
    participant App 
    participant Database 
    participant Broker as Broker (redis)
    participant Worker as Celery Worker
    Client->>App: POST /api/document/create
    activate App
    App->>Database: Insert document
@chi-feng
chi-feng / import_parent.py
Created May 10, 2022 09:46
Python Add parent directory to import path
import sys
import os
# add parent directory to import path
current = os.path.dirname(os.path.realpath(__file__))
parent = os.path.dirname(current)
sys.path.append(parent)
0eNrsvV2PI0eW3/1VCnX12GAJGe8RgtcXhmHYwFwsoPHVjNBgd7FbxFQXyyyWdoSFvvsTySRZ7GIE8/+rlmdhrxcLadSd+Y/Ic+KcODyv/3r78eFl9bRdP+4+fNxs/nb747++/snz7Y9/OfvP8e/uV8+ftuun3XrzePvj7X95WT/c3+x+WT8v6j9Xjzf/slzvbj5vtjc/bR6W2+X95ubP2+X68fC3z7vl16ebnz4tP3/ePNx/84f/vHxcPfxw86fN45eb5/X96mbzefqzm68vz7ubj6ubp4flp9X9zePq77ub3WZ8aP345Ye/Pv718ac9wvLmp93maXGz3eyWu9WNycPN/erLdrWqe1s+3h/WWT5u6qrb/bM367r68usBegT9tF2N7y5v7jcvHx9W+6d+uF3cPj8un+52m7sv2/X9SIW/3/5obF7c/rb/9++L2+XH583Dy251Nz75VDd2++Nu+7Ja3D5tntcjse62q4flbv3r6i1M3KPcmVhR1p82jxPNn9dfHpcP4zO7355WldLr3epr3chj3W79r91I1Lvnurvb8bXH+9UI9fui8eKv6+3upf7J6d3piTt79qb9/efF7epxV3e6mtbf/8dvHx5fvn5cbSv06e1PL9tfV/d3df0R8vh1h4+J08eEoULfr7erT9PfxXFjbxDt637Gj/nyy66Dmcwe05dvMW0D08mYTsb0MmaQMYOMmWTMKGMWGTOpmFnnUZYxdR4VGVPnkRlkUJ1JxsigOpeMLEpFZ5ORZanofDKyMBXAKFmaCmCULE4FMEqWJzMATmUdFbCq6Kg6r+ygo+rMskZH1bllZbEyRueWdTqqzi3rdVTAraCjAm5FHRVwS5ctC7ily5YF3NJly+rccrpsWZ1bTpctq3PL6bLlgPmny5bTueV02XKAW7psOcAtXbYc4JYuWx5wS5ctD7ily5bXueV12fI6t7wuW17nltdlK+jc8rpsBfDjSpetALily1YA3NJlKwBu6bIVAbd02YqAW7psRfBjWJetqHM
@chi-feng
chi-feng / gist:f72cb0b9f82efb06751c9e2bc5f31862
Created March 11, 2021 16:23
matplotlib latex configuration
# need to set configuration before import pyplot from matplotlib
import matplotlib
matplotlib.rc('font', size='10')
matplotlib.rc('text', usetex=True)
matplotlib.rc('font', family='serif')
matplotlib.rc('font' ,serif='Computer Modern')
matplotlib.rcParams['text.latex.preamble']=[r"\usepackage{amsmath}\usepackage{amsfonts}\usepackage{amssymb}"]
@chi-feng
chi-feng / twitter_replies.ipynb
Created January 27, 2021 07:54
Twitter reply scraper using Tweepy
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.