Exuanbo’s Wiki
This page is built using Emacs Org mode with Gulp.js, inspired by GeekPlux. Source code is hosted in this repo.
1 Life
1.1 Style
1.1.1 Minimalism
- Introduction: What Minimalism is and is not – Manu
- To me, Minimalism has nothing to do with anything visual.
- I wouldn’t call minimalism a lifestyle. I’d much rather refer to it as a mindset or a guiding principle.
1.1.2 Self-control
1.2 Skill
1.2.1 Typing
- 双拼
- 选择输入法的哲学:兼论双拼的优缺点 - 少数派
- 录入文字的过程可以简单分为两个环节:1. 大脑将思考的内容转化为可以通过键盘录 入的内容(比如字形、字音);2. 通过键盘将字形或字音录入电脑并组合为最终文字。
- 我们的大脑更容易把思维转化为声音而不是文字 ,甚至有很多人必须先把思维转化 为声音然后才能进一步转化为文字:我们见过很多人在输入的时候嘴里念念有词,这就 是通过声音来辅助文字呈现的一种方式,但我们从来没见过有人说话的时候,需要拿支 笔边写边说。
- 双拼输入法是拼音输入法的一种,因此它继承了拼音输入法在第一环节的优势;而由于 简化了复合声母和韵母,在第二环节的效率追平甚至超过了五笔输入法。
- 选择输入法的哲学:兼论双拼的优缺点 - 少数派
- RIME
- alswl/ Rime - Rime configuration for Squirrel (macOS) & fcitx-rime
- Squirrel
- placeless/ squirrel_config - Rime 鼠须管小鹤双拼配置
- cnfeat/ Rime - 鼠须管 小鹤双拼 输入法配置及配色方案
1.2.2 Bypass GFW
- Server
- V2Ray
- trojan
- TheWanderingCoel/ Trojan-Qt5 - A cross-platform trojan GUI client based on Shadowsocks-qt
- Jrohy/ trojan - trojan多用户管理部署程序, 支持web页面管理
- p4gefau1t/ trojan-go - Golang实现的Trojan代理,支持自动证书申请/多路复用/路 由功能/CDN中转,多平台,无依赖
- Client
- App
- mellow-io/ mellow - Mellow is a rule-based global transparent proxy client for Windows, macOS and Linux
- Qv2ray/ Qv2ray - C++17/Qt5
- yichengchen/ ClashX - macOS
- paradiseduo/ ShadowsocksX-NG-R8 - macOS
- lzdnico/ ClashWeb - Windows
- Shadowroket - iOS | paid app
- NetchX/ Netch - 开源的 Windows 平台游戏加速工具
- Subscription
- tindy2013/ subconverter - Utility to convert between various subscription format
- tindy2013/ _subconverter_configs
- Sabrina Rule Generator
- Subscription Converter
- Rules
- geekdada/ surgio - Generating rules for Surge, Clash, Quantumult… like a PRO
- ConnersHua/ Profiles at master - 神机规则
- lhie1/ Rules - 洞主规则
- GeQ1an/ Rules - Stick Rules, 本规则适合任意地区使用 Quantumult X、境外使用 Quantumult 和 ClashX 的 “小白/懒人” 用户配合相关节点使用,最初通过 lhie1 Rules 修 改而来,目前参考了众多优秀规则
- Hackl0us/ SS-Rule-Snippet - Design for Surge, Quantumult, Shadowrocket, Surfboard, clash(X)
- SNSLogty /pixiv-hosts-1 - You know what it is
- App
- Other
- GoogleHosts
- geph-official/ geph2 - Geph (迷霧通) is a modular Internet censorship circumvention system designed specifically to deal with national filtering
- Tutorial
1.3 Tool
- 在工具应用选择上,为什么我开始相信 Unix 哲学? - 少数派
- Unix philosophy - Wikipedia
- 理念 1. 一个应用,一个目标
- 理念 2. 组合胜过单干
- 理念 3. 一切皆文件
- 最后, 寻找心中的「独角兽」
1.4 Hobby
1.4.1 Marathon
- 知乎圆桌《马拉松之路》
核心力量训练是指针对核心区域肌肉(主要是腹部、下背部和骨盆部肌群)及其深层小肌 肉进行的力量、稳定、平衡等能力的训练,它不同于传统的腰腹力量训练,而是使核心区 域的整体原动肌和局部稳定肌均能通过训练得到发展和提高。核心力量训练的目的就是使 整个机体协调起来,确保训练者在做动作时核心肌群起到稳定躯体,传输能量的作用。
- 越野跑和公路跑有哪些区别? - 知乎
跑步是对现实生活的逃避,是一种解脱或者说移情。
- 动画《强风吹拂》
- Episode 005 — 纵使强风起,人生不言弃
- 对一个跑者的最高赞美是什么。快吗?我觉得应该是强。
- 无论你处于什么立场、曾经有过什么样的遭遇,面对跑步这件事,所有人都得站在同 一条起跑线上。不论最后是成功或失败,在这个当下,都取决于自己这幅身躯。正因 为如此,才会有快乐,有痛苦,最后是无上的自由。
- Episode 005 — 纵使强风起,人生不言弃
1.4.2 Podcast
时隔近百年,当下的中文播客圈,听众之中流行着一个说法,将中文播客分类为「陪伴型 / 湿货」和「硬核型 / 干货」两种类型。苹果发布的 2019 年最佳中文播客榜单中,不 乏「大内密谈」「日谈公园」「跟宇宙结婚」这样的「闲话类」陪伴型播客,也丰盈着 「忽左忽右」「博物志」「声东击西」「不可理论」等信息度相对密集、知识点充沛的播 客节目。前者往往以北京为核心,主要是北方语系;后者则以上海为中心,且基本有海外 背景。
- App
泛用型播客客户端:
- Castro - iOS | Recommand
- Overcast - iOS
- Pocket Casts - Android & iOS
- Explore
Listen Notes: The best podcast search engine
The most comprehensive podcast database online. Discover best podcasts. Search podcast show notes and audio transcripts by people, places, or topics.
- 播客 Feed 订阅
- 中文独立播客 - 发现与推荐高质量的中文独立播客
Jesse Chan (@Jesoooor) 言:
独立 = 创作过程不受限制、影响。
这个限制和影响可能来自资本、技术、商业、受众。但你不可能找到一个一刀切的标准来定义「独立」。
小众厂牌 Spotify 独占,能叫独立音乐吗?微软独占的《Cuphead》叫独立游戏吗?
这是要从内容本身出发去判断的,真正「独立」的内容会散发出独一无二的气质。
- Subscription
- Luke’s English Podcast
这是一档探索并发现优质单期英文播客的中文节目。每期节目将为你推荐三期不同主题或 类型的英文播客,讲述这些播客的精彩之处,整理与其相关的信息与知识。我们希望能帮 助你更高效地接触英文原生内容,并享受随之而来的快乐与启发。
这是一个主张追求个体自由与探寻真理的实验计划。我们见证了第一次工业革命以来科技 对人类社会的极大推动与助益,但也意识到资本主义与市场经济不可避免地催生了消费文 化、剥夺了个人价值、并窃取了大众时间。带着对生命的有限性与无目的性的敬畏,我们 试图为读者与听众提供更全面的觉察自我与认知世界的工具,以不断重建当下的方式穿越 时间、抵达生活的本质。
一家以 Engineer 视角面对世界的字节咖啡店,提供一支独立极简、健康明亮、科学主调、 人文余韵的声波咖啡豆。人间指南主播 hb 曾打趣说是「科技与人文十字路口的街角咖啡 店」,我觉得需要改成「科学与人文的十字路口」,特指自然科学。技术固然重要,但背 后的科学是基础是理论是根基,一名科研工作者必须谨记这一点。
这是一档探讨科技、商业、设计和生活之间混沌关系的播客节目,也是风险基金 ONES Ventures 关于热情、趣味和好奇心的音频记录。我们希望通过这档播客,能让熟悉的事 物变得新鲜,让新鲜的事物变得熟悉。
- 机核网 GADIO 游戏广播
- 反波 Antiwave - web.archive.org
- Episode
特别嘉宾木遥与 Rio 和吴涛讨论了数学与编程之间的联系。话题包括但不限于:数学系 的发展、统计学、数学与科学的关联、明尼苏达的天气、数学背景对于成为程序员的助益、 Google 的工程师驱动特性、人们嘲讽新泽西的原因、养猫的经验、抽象几何学、Haskell、 编程动手能力的来源、学习编程语言的意义、可视化编程、Lisp、FORTRAN、Go、C++、 Swift、Optional、Google 的激励机制、欧洲的社会保障体制、技术变革带来的社会影响、 中国政治坐标系测试、和食物替代饮料 Soylent。
1.5 Digest
2 Job
2.1 Prepare
- 如何得到 Google 的工作机会? - 知乎
- geekcompany/ ResumeSample - 程序员简历模板系列
- azl397985856/ fe-interview - 大前端面试宝典
- labuladong的算法小抄
- azl397985856/ leetcode - leetcode题解,记录自己的leetcode解题之路
2.1.1 Interview
2.2 Resource
- lukasz-madon/ awesome-remote-job - A curated list of awesome remote jobs and resources
- greatghoul/ remote-working - 本列表只收录中国国内的资源或者对国内受众友好的国外资源
2.3 Experience
3 General Learning
4 Language
4.1 English
4.1.1 Vocabulary
4.1.2 Grammar
- 英语语法新思维初级/中级/高级教材
- 英语常用词疑难用法手册 - 豆瓣
- McGraw-Hill’s Essential American Idioms - 豆瓣
4.1.3 Listening
4.1.4 Reading
- “Stuff White People like”
- “How to Be Black”
- “Hunger of Memory”
- “Dataclysm”
- ProCon.org - Pros and Cons of Controversial Issues
- Actively Learn - 任务导向型阅读训练
4.1.5 Speaking
- “White Girl Problems” - novel
- “New Girl” - TV Series
- “Girls” - TV Series
- “Jessie” - TV Series
- “Dream School” - Netflix TV Series
5 Reading
5.1 Magazine
6 Writing
9 Free & Open
9.1 Privacy
9.2 Eric S. Raymond’s
9.4 Github
9.4.1 Github Pages
How to fix HTTP 404 on Github Pages?
If you don’t use Jekyll, the workaround is to place a file named
.nojekyll
in the root directory.
9.4.2 Github Actions
- GitHub Actions 入门教程 - P3TERX ZONE
- GitHub Actions 手动触发方式 - P3TERX ZONE
Star
name: Test on: watch: types: started jobs: build: runs-on: ubuntu-latest if: github.event.repository.owner.id == github.event.sender.id steps: - name: Checkout uses: actions/checkout@v2 # ...
Webhook
name: Webhook Test on: repository_dispatch: types: [helloworld, test, none] jobs: build: runs-on: ubuntu-latest steps: - name: Hello World if: contains(github.event.action, 'hello') run: | echo My name is P3TERX. echo Hello World! - name: TEST if: github.event.action == 'test' run: | echo test
curl -X POST https://api.github.com/repos/:owner/:repo/dispatches \ -H "Accept: application/vnd.github.everest-preview+json" \ -H "Authorization: token ACTIONS_TRIGGER_TOKEN" \ --data '{"event_type": "TRIGGER_KEYWORDS"}'
Caching dependencies to speed up workflows - GitHub Help
name: Caching with npm on: push jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Cache node modules uses: actions/cache@v1 env: cache-name: cache-node-modules with: path: ~/.npm # npm cache files are stored in `~/.npm` on Linux/macOS key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }} restore-keys: | ${{ runner.os }}-build-${{ env.cache-name }}- ${{ runner.os }}-build- ${{ runner.os }}- - name: Install Dependencies run: npm install - name: Build run: npm build - name: Test run: npm test
- matchai/ awesome-pinned-gists - A collection of awesome dynamic pinned gists for GitHub
- matchai/ waka-box - Update a pinned gist to contain your weekly WakaTime stats
10 Computer Science
- ossu/ computer-science - Path to a free self-taught education in Computer Science
- Teach Yourself Computer Science
- Crash Course Computer Science - 中英字幕
11 Programming
11.1 Functional Programming
11.1.1 Haskell
- Environment Setup
Haskell Platform - Installs GHC, Cabal, and some other tools, along with a starter set of libraries in a global location on your system.
curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh curl -sSL https://get.haskellstack.org/ | sh
Using Homebrew
brew install cabal-install ghc brew haskell-stack stack setup
11.2 C++
- TheLartians/ ModernCppStarter - Kick-start your C++! A template for modern C++ projects using CMake, CI, code coverage, clang-format, reproducible dependency management and more
- abseil/ abseil-cpp - Abseil Common Libraries (C++)
11.3 Java
- hollischuang/ toBeTopJavaer - Java工程师成神之路
11.4 Python
- satwikkansal/ wtfpython - Exploring and understanding Python through surprising snippets
11.4.1 Tips
What is the easiest way to remove all packages installed by pip?
pip freeze > requirements.txt pip uninstall -r requirements.txt -y # or a single command without any file pip uninstall -y -r <(pip freeze)
12 Algorithm
- The Algorithms · GitHub - Open Source resource for learning Data Structures & Algorithms and their implementation in any Programming Language
13 Web
- Code Guide by @mdo - Standards for developing consistent, flexible, and sustainable HTML and CSS
- gothinkster/ realworld - Exemplary fullstack Medium.com clone powered by React, Angular, Node, Django, and many more
13.1 Javascript
- trekhleb/ javascript-algorithms - Algorithms and data structures implemented in JavaScript with explanations and links to further readings
jQuery.getScript alternative in native JavaScript - Stack Overflow
const loadScript = (source, options) => { return new Promise((resolve, reject) => { let script = document.createElement('script') const prior = document.getElementsByTagName('script')[0] function onloadHander(_, isAbort) { if (isAbort || !script.readyState || /loaded|complete/.test(script.readyState)) { script.onload = null script.onreadystatechange = null script = undefined isAbort ? reject(new Error('Failed to load script')) : resolve() } } const attributes = { async: false, defer: true } if (options) { for (const i in options) { attributes[i] = options[i] } } for (const i in attributes) { script[i] = attributes[i] } script.onload = onloadHander script.onreadystatechange = onloadHander script.src = source prior.parentNode.insertBefore(script, prior) }) }
- IntersectionObserver - Web APIs | MDN
- verlok/ lazyload - written in plain “vanilla” JavaScript
- JSMonk/ hegel - An advanced static type checker
- alpinejs/ alpine - A rugged, minimal framework for composing JavaScript behavior in your markup. Think of it like Tailwind for JavaScript
13.2 Typescript
- Home | TypeDoc - A documentation generator for TypeScript projects
13.3 Node.js
13.4 NPM
- NPM镜像-NPM下载地址-NPM安装教程-阿里巴巴开源镜像站
nvm install node --reinstall-packages-from=$(nvm current)
13.5 Gulp.js
gulp.js - The streaming build system
function defaultTask(cb) { // place code for your default task here cb(); } exports.default = defaultTask
13.5.1 Example
same
src
anddest
function html() { return src('public/**/*.html', { base: '.' }) .pipe(htmlmin({ collapseWhitespace: true })) .pipe(dest('.')) }
gulp.watch()
+ browser-syncconst browserSync = require('browser-sync').create() function server() { browserSync.init({ server: { baseDir: './public', }, }) watch( [ 'assets/**', '!assets/build/**', 'content/**', 'layouts/**', 'static/**', 'config.toml', ], { ignoreInitial: false }, series('default') ) watch('public/**').on('change', browserSync.reload) } exports.server = server
13.6 PostCSS
13.6.1 Plugins
- postcss/ postcss-import - PostCSS plugin to inline @import rules content
- @fullhuman/postcss-purgecss
- autoprefixer
cssnano - A modular minifier based on the PostCSS ecosystem
const plugins = [ cssnano({ preset: ['default', { discardComments: { removeAll: true } }] }) ]
13.8 CSS
- robsheldon/ sscaffold-css - Combines css rules from normalize.css and skeleton.css
- Let’s Make a Grid-Powered Resume! | CSS-Tricks
- How to Scale SVG | CSS-Tricks
13.9 Static Site Generator
13.9.1 Hugo
- fenneclab/ hugo-bin - Binary wrapper for Hugo
- dirkolbrich/ hugo-theme-tailwindcss-starter - Starter files for a Hugo theme with Tailwindcss
13.9.2 Eleventy
A simpler static site generator. An alternative to Jekyll. Written in JavaScript. Transforms a directory of templates (of varying types) into HTML.
Works with HTML, Markdown, Liquid, Nunjucks, Handlebars, Mustache, EJS, Haml, Pug, and JavaScript Template Literals.
13.9.3 Saber
()==[:::::::::::::> Build static sites in Vue.js, without the hassle
13.10 Browser
- 这大概就是目前最好的翻译解决方案了! - 奔跑中的奶酪 - 沙拉查词
13.10.1 Userscript
13.10.2 Chrome
- Chrome Extensions
- uBlacklist
- truedread/ netflix-1080p - Chrome extension to play Netflix in 1080p and 5.1
- Sync Sofa (beta) - Online Video Synchronizer - Chrome Web Store
13.11 Resource
13.11.1 Icons
- The best Favicon Generator (completely free) | Favicon.io
- Url encoder for SVG
- Ikonate – fully customisable & accessible vector icons
- iconmonstr - Free simple icons for your next project
- Simple Icons - Free SVG icons for popular brands
- refactoringui/ heroicons - A set of free MIT-licensed high-quality SVG icons for UI development
- tabler/ tabler-icons - A set of over 300 free MIT-licensed high-quality SVG icons for you to use in your web projects
14 iOS
15 Game
15.1 General
15.2 Development
16 Git
- Learn Git Branching - the most visual and interactive way to learn Git on the web
- commitizen/ cz-cli - Simple commit conventions for internet citizens
git reset
(default) --soft --mixed --hard ----------------------------------------- commit (repository) | | | V | | ----------------------------------------- stage (index) | | V | ----------------------------------------- unstage (working tree) | V discard
16.1 Hacks
16.1.1 Hook
- auto sync to Dropbox after commit
vim ~/.gitconfig
[core] hooksPath = /Users/xuanbo/Dropbox/git/hooks # your hook file folder
vim ~/Dropbox/git/hooks/post-commit
#!/usr/bin/env bash set -e # always immediately exit upon error # directory config. ending slashes are important! src_dir="$HOME/repositories/" dest_dir="$HOME/Dropbox/repositories/" # run the sync rsync -arv --delete-after --delete-excluded --progress \ --filter="dir-merge,- .gitignore" \ --exclude-from="$HOME/.gitignore_global" \ # if exists --chmod="F-w" \ "$src_dir" "$dest_dir"
16.2 Pull-Request steps
The beginner’s guide to contributing to a GitHub project
- Fork the project and clone locally
git remote add upstream [email protected]:xxx/xxx.git
git checkout -b newBranch
- Do something and commit
git pull --rebase upstream master
git push origin
16.3 Command
git init # 在当前目录新建一个 Git 代码库 git clone [url] # 下载一个项目和它的整个代码历史 git config --list # 显示当前的 Git 配置 git config -e [--global] # 编辑 Git 配置文件 git add # 添加指定文件到暂存区 git rm # 删除工作区文件,并且将这次删除放入暂存区 git commit -m [message] # 提交暂存区到仓库区 git commit -a # 提交工作区自上次 commit 之后的变化,直接到仓库区 git commit --amend -m [message] # 使用一次新的 commit,替代上一次提交 如果代码没有任何新变化,则用来改写上一次 commit 的提交信息 git commit --amend [file1] [file2] ... # 重做上一次 commit,并包括指定文件的新变化 # 分支相关 git branch # 列出所有本地分支 git branch -r # 列出所有远程分支 git branch [branch-name] # 新建一个分支,但依然停留在当前分支 git checkout [branch-name] # 切换到指定分支,并更新工作区 git checkout -b [branch] # 新建一个分支,并切换到该分支 git branch [branch] [commit] # 新建一个分支,指向指定 commit git checkout -b [branch] [tag] # 新建一个分支,指向某个 tag git branch --track [branch] [remote-branch] # 新建一个分支,与指定的远程分支建立追踪关系 git branch --set-upstream [branch] [remote-branch] # 建立追踪关系,在现有分支与指定的远程分支之间 git merge [branch] # 合并指定分支到当前分支 git cherry-pick [commit] # 选择一个 commit,合并进当前分支 git branch -d [branch-name] # 删除分支 git push origin --delete [branch-name] # 删除远程分支 git branch -dr [remote/branch] # 删除远程分支 # 标签 git tag # 列出所有 tag git tag [tag] # 新建一个 tag 在当前 commit git tag [tag] [commit] # 新建一个 tag 在指定 commit git show [tag] # 查看 tag 信息 git push [remote] [tag] # 提交指定 tag git push [remote] --tags # 提交所有 tag # 查看 git status # 显示有变更的文件 git log # 显示当前分支的版本历史 git log --stat # 显示 commit 历史,以及每次 commit 发生变更的文件 git log --follow [file] # 显示某个文件的版本历史,包括文件改名 git log -p [file] # 显示指定文件相关的每一次 diff git blame [file] # 显示指定文件是什么人在什么时间修改过 git diff # 显示暂存区和工作区的差异 git diff --cached [file] # 显示暂存区和上一个 commit 的差异 git diff HEAD # 显示工作区与当前分支最新 commit 之间的差异 git diff [first-branch]...[second-branch] # 显示两次提交之间的差异 git show [commit] # 显示某次提交的元数据和内容变化 git show --name-only [commit] # 显示某次提交发生变化的文件 git show [commit]:[filename] # 显示某次提交时,某个文件的内容 git reflog # 显示当前分支的最近几次提交 # 远程 git fetch [remote] # 下载远程仓库的所有变动 git remote -v # 显示所有远程仓库 git remote show [remote] # 显示某个远程仓库的信息 git remote add [shortname] [url] # 增加一个新的远程仓库,并命名 git pull [remote] [branch] # 取回远程仓库的变化,并与本地分支合并 git push [remote] [branch] # 上传本地指定分支到远程仓库 git push [remote] --force # 强行推送当前分支到远程仓库,即使有冲突 git push [remote] --all # 推送所有分支到远程仓库 # 撤销 git checkout [file] # 恢复暂存区的指定文件到工作区 git checkout [commit] [file] # 恢复某个 commit 的指定文件到工作区 git checkout . # 恢复上一个 commit 的所有文件到工作区 git reset [file] # 重置暂存区的指定文件,与上一次 commit 保持一致,但工作区不变 git reset --hard # 重置暂存区与工作区,与上一次 commit 保持一致 git reset [commit] # 重置当前分支的指针为指定 commit,同时重置暂存区,但工作区不变 git reset --hard [commit] # 重置当前分支的 HEAD 为指定 commit,同时重置暂存区和工作区,与指定 commit 一致 git reset --keep [commit] # 重置当前 HEAD 为指定 commit,但保持暂存区和工作区不变 git revert [commit] # 新建一个 commit,用来撤销指定 commit,后者的所有变化都将被前者抵消,并且应用到当前分支
17 Text Editor
- EditorConfig
- editorconfig-emacs - EditorConfig plugin for Emacs
17.1 Emacs
+================================+ | | +===============================+ | | | | +===============================+ | | | | | | | ..... Frame 3 | Window 2 | | | | | | | |---+ |--------------| Window 1 | | ......... Frame 2 | | |---+ | Window 3 | | | | | ............. Frame 1 +-------------------------------+
17.1.1 Emacs Lisp
17.1.2 Tips
eval-after-load vs. mode hook - Stack Overflow
Code wrapped in
eval-after-load
will be executed only once, so it is typically used to perform one-time setup such as setting default global values and behaviour. An example might be setting up a default keymap for a particular mode. Ineval-after-load
code, there’s no notion of the “current buffer”.Mode hooks execute once for every buffer in which the mode is enabled, so they’re used for per-buffer configuration. Mode hooks are therefore run later than
eval-after-load
code; this lets them take actions based upon such information as whether other modes are enabled in the current buffer.The difference between setq and setq-default in Emacs Lisp
Some variables in Emacs are “buffer-local”, meaning that each buffer is allowed to have a separate value for that variable that overrides the global default.
tab-width
is a good example of a buffer-local variable.If a variable is buffer-local, then
setq
sets its local value in the current buffer andsetq-default
sets the global default value.If a variable is not buffer-local, then
setq
andsetq-default
do the same thing.
17.1.3 Resource
- Blog
- GitHub
- Github Search · stars:>20 extension:el language:elisp
- lujun9972/ emacs-document - translate emacs documents to Chinese for convenient reference
- mastering-emacs-in-one-year-guide /guide-zh.org
- Tutorial
17.1.4 Packages
- NicolasPetton/ gulp-task-runner - Run gulp tasks from Emacs
M-x gulp
- It’s Magit! A Git Porcelain inside Emacs
17.2 Spacemacs
syl20bnr/ spacemacs - A community-driven Emacs distribution
17.2.1 Configuration
A dotdirectory /.spacemacs.d
can be used instead of a dotfile. If you want to use this option, move /.spacemacs
to /.spacemacs.d/init.el
.
My configuration exuanbo/ dotfiles/.spacemacs.d
for reference:
17.2.2 Layers
brew install ispell
17.2.3 Tips
Environment variable warnings #3920
Put
(setq exec-path-from-shell-arguments '("-l"))
in yourdotspacemacs/user-init
17.3 Doom Emacs
hlissner/ doom-emacs - An Emacs configuration for the stubborn martian vimmer
- Doom Emacs Documentation
- hlissner/ emacs-doom-themes
- hlissner/ doom-snippets - The Doom Emacs snippets library
My configuration .doom.d
17.3.1 Tips
hlissner/doom-emacs#2941 doom upgrade errors with straight.el
hlissner/doom-emacs#2937 Fresh install fails with “destination path … alrea…
rm -rf ~/.emacs.d/.local/straight/repos/straight.el doom sync
17.3.2 Modules
- term/vterm -
+vterm/toggle
(SPC o t
): Toggle vterm pop up window in the current project
17.3.3 Hacks
Need doom/toggle-maximized command #397
(add-to-list 'initial-frame-alist '(fullscreen . maximized))
TAB was changed to toggle only the visibility state of the current subtree, rather than cycle through it recursively. This can be reversed with:
(after! evil-org (remove-hook 'org-tab-first-hook #'+org-cycle-only-current-subtree-h))
On some systems (particularly MacOS), manipulating the fringes or window margins can cause Emacs to crash. This is most prominent in the Doom Dashboard (which tries to center its contents), in org-mode buffers (which uses
org-indent-mode
to create virtual indentation), or magit. There is currently no known fix for this, as it can’t be reliably reproduced. Your best bet is to reinstall/rebuild Emacs or disable the errant plugins/modules. e.g.To disable org-indent-mode:
(after! org (setq org-startup-indented nil))
Or disable the
:ui doom-dashboard
&:tools magit
modules (see #1170).
17.4 Other configuration
- purcell /emacs.d - An Emacs configuration bundle with batteries included
17.5 Vim
- amix/ vimrc - The ultimate Vim configuration
- vim-bootstrap - is generator provides a simple method of generating a .vimrc configuration for vim
17.6 Visual Studio Code
- awesome-vscode - A curated list of delightful VS Code packages and resources
- Base16 Terminal Colors for Visual Studio Code
- 从 Emacs 和 Vim 到 VSCode - 知乎
- VSpaceCode - Spacemacs’ like keybindings for Visual Studio Code
- 那些你应该考虑卸载的 VSCode 扩展 - 知乎
- kahole /vscode-magit - Magit for VSCode
18 Org Mode
18.1 Configuration
18.1.1 General
(setq org-export-with-sub-superscripts nil org-html-doctype "html5" org-html-html5-fancy t ; enable new block elements introduced with the HTML5 standard org-html-head-include-default-style nil org-html-htmlize-output-type 'css)
Org-mode : disable indentation when promoting and demoting trees + subtrees -…
(setq org-adapt-indentation nil)
Org-mode: Source block doesn’t respect parent buffer indentation
(setq org-src-preserve-indentation nil org-edit-src-content-indentation 0)
18.1.2 for Spacemacs
dotspacemacs-configuration-layers '((org :variables org-projectile-file "TODOs.org" org-want-todo-bindings t))
(defun dotspacemacs/user-config () (with-eval-after-load 'org (setq ... )))
18.1.3 gongzhitaao/ orgcss
When exported to HTML, there are three options for code highlighting, controlled by the variable org-html-htmlize-output-type
.
(setq org-html-htmlize-output-type 'inline-css)
This is the default setting. It highlights the code according to the current Emacs theme you are using. It directly applies color to the code with inline styles, e.g.,
<span style="color: 0x000000">int</span>
.The problem is that the highlight theme depends on the Emacs theme. If you use a dark theme in your Emacs but a light theme (usually we like light themed web pages) web pages, the exported code are hardly illegible due to the light font color, or vice versa.
(setq org-html-htmlize-output-type nil)
This configuration disables highlighting by
htmlize
. You may use a third-party Javascript highlight library. I recommend highlight.js if I need code highlight.There are two problems:
- The problem is that you have to rely on highlight.js support on a certain language which is occasionally missing, e.g.,
emacs-lisp
,org
, etc. highlight.js
by default does not recognized the tags and classes exported by org mode. You need some extra Javascript code in your Org file.
- The problem is that you have to rely on highlight.js support on a certain language which is occasionally missing, e.g.,
(setq org-html-htmlize-output-type 'css)
This is similar to the first optional, instead of using inline styles, this will assign classes to each component of the code, e.g.,
<span class="org-type">int</span>
, and you could create your own stylesheet for.org-type
.To obtain a list of all supported org classes, run
M-x org-html-htmlize-generate-css
. This will create a buffer containing all the available org style class names in the current Emacs session.
18.2 Hacks
org mode - Set the background of org-exported <code> blocks according to them…
(defun my/org-inline-css-hook (exporter) "Insert custom inline css to automatically set the background of code to whatever theme I'm using's background" (when (eq exporter 'html) (let* ((my-pre-bg (face-background 'default)) (my-pre-fg (face-foreground 'default))) (setq org-html-head-extra (concat org-html-head-extra (format "<style type=\"text/css\">\n pre.src {background-color: %s; color: %s;}</style>\n" my-pre-bg my-pre-fg)))))) (add-hook 'org-export-before-processing-hook 'my/org-inline-css-hook)
the same way to insert inline CSS or Javascript from local files:
(defun my/org-inline-source-hook (exporter) (when (eq exporter 'html) (setq org-html-head-extra (concat "<style type=\"text/css\">\n" "<!--/*--><![CDATA[/*><!--*/\n" (with-temp-buffer (insert-file-contents "style.css") (buffer-string)) "\n" "/*]]>*/-->\n" "</style>\n" "<script type=\"text/javascript\">\n" "<!--/*--><![CDATA[/*><!--*/\n" (with-temp-buffer (insert-file-contents "script.js") (buffer-string)) "\n" "/*]]>*/-->\n" "</script>\n")))) (add-hook 'org-export-before-processing-hook 'my/org-inline-source-hook)
- emacs - how to tell org-mode to embed my css file on HTML export? - Stack Ove…
- 有没有办法让org-mode导出的html页面漂亮一点? - Emacs-general - Emacs China
- rgb-24bit/ org-html-theme-list - 这个仓库用于存放我收集的
org-export-to-html
样式或主题 - Feature: +style feature that provide better org HTML export default by fuxialexander · Pull Request #461 · hlissner/doom-emacs
;; Embed inline CSS read from a file. (defun my-org-inline-css-hook (exporter) "Insert custom inline css" (when (eq exporter 'html) (let* ((dir (ignore-errors (file-name-directory (buffer-file-name)))) (path (concat dir "style.css")) (homestyle (and (or (null dir) (null (file-exists-p path))) (not (null-or-unboundp 'my-org-inline-css-file)))) (final (if homestyle my-org-inline-css-file path))) (if (file-exists-p final) (progn (setq-local org-html-head-include-default-style nil) (setq-local org-html-head (concat "<style type=\"text/css\">\n" "<!--/*--><![CDATA[/*><!--*/\n" (with-temp-buffer (insert-file-contents final) (buffer-string)) "/*]]>*/-->\n" "</style>\n"))))))) (add-hook 'org-export-before-processing-hook 'my-org-inline-css-hook)
18.3 App
- beorg - iOS | Recommand | in-app purchases
- Mobile Org - iOS | Open Source
19 LaTeX
20 Research
21 OS
How to store dotfiles | Atlassian Git Tutorial - The best way to store your dotfiles: A bare Git repository
git init --bare $HOME/.cfg alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME' config config --local status.showUntrackedFiles no echo "alias config='/usr/bin/git --git-dir=$HOME/.cfg/ --work-tree=$HOME'" >> $HOME/.zshrc
config status config add .vimrc config commit -m "Add vimrc" config add .zshrc config commit -m "Add zshrc" config push
- SukkaW/ dotfiles - My development environment and config
- oh-my-zsh
- romkatv/ powerlevel10k - A Zsh theme. It emphasizes speed, flexibility and out-of-the-box experience.
zsh - Exiting terminal running “nohup ./my_script &” => “You have running job…
If you want to not see that message, simply pass the job id to disown, like so:
disown %1
Or, start the job with
&!
(zsh-specific trick):nohup ./my_script.sh &!
21.1 Linux
21.1.1 Server
21.2 MacOS
- Mac Keyboard Shortcuts & Keystrokes | Dan Rodney
- Awesome Mac
- Awesome macOS open source applications
- Homebrew
- homebrew-cask
brew leavese
Show installed formulae that are not dependencies of another installed formulaggPeti/ homebrew-rmrec - Quick and simple command to remove a Homebrew package and its dependencies
brew tap ggpeti/rmrec brew rmrec pkgname
- iTerm2
- Alfred
21.2.1 Setup
- Mac OS X Setup Guide
改变 Launchpad 中应用图标的大小
defaults write com.apple.dock springboard-columns -int 列数 defaults write com.apple.dock springboard-rows -int 行数 defaults write com.apple.dock ResetLaunchPad -bool TRUE killall Dock
21.2.2 Zsh
.zshenv
is sourced on all invocations of the shell, unless the -f
option is set. It should contain commands to set the command search path, plus other important environment variables. .zshenv
should not contain commands that produce output or assume the shell is attached to a tty.
21.2.3 Tips
Use iconutil to Create an icns File Manually
from stackoverflow.com/questions/12306223
mkdir MyIcon.iconset # convert a 1024x1024 png (named "Icon1024.png") to the required icns file sips -z 16 16 Icon1024.png --out MyIcon.iconset/icon_16x16.png sips -z 32 32 Icon1024.png --out MyIcon.iconset/[email protected] sips -z 32 32 Icon1024.png --out MyIcon.iconset/icon_32x32.png sips -z 64 64 Icon1024.png --out MyIcon.iconset/[email protected] sips -z 128 128 Icon1024.png --out MyIcon.iconset/icon_128x128.png sips -z 256 256 Icon1024.png --out MyIcon.iconset/[email protected] sips -z 256 256 Icon1024.png --out MyIcon.iconset/icon_256x256.png sips -z 512 512 Icon1024.png --out MyIcon.iconset/[email protected] sips -z 512 512 Icon1024.png --out MyIcon.iconset/icon_512x512.png cp Icon1024.png MyIcon.iconset/[email protected] iconutil -c icns MyIcon.iconset
21.3 Windows
- t1m0thyj /WinDynamicDesktop - Port of macOS Mojave Dynamic Desktop feature to Windows 10
23 Self-hosting
This is a list of Free Software network services and web applications which can be hosted locally. Non-Free software is listed on the Non-Free page.
23.1 Nginx Configuration
- Mozilla SSL Configuration Generator
- fotock/ nginx.conf - Nginx SSL 安全配置最佳实践
# 生成 dhparam.pem 文件, 在命令行执行任一方法: # 方法1: 很慢 openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 # 方法2: 较快 # 与方法1无明显区别. 2048位也足够用, 4096更强 openssl dhparam -dsaparam -out /etc/nginx/ssl/dhparam.pem 4096
23.2 Analytics
Ackee - Self-hosted analytics tool for those who care about privacy. MIT
Nodejs
Ackee/docs/SSL and HTTPS - Nginx configuration
# # Set "$cors_header" to avoid "if" inside location context # https://www.nginx.com/resources/wiki/start/topics/depth/ifisevil/ # https://stackoverflow.com/questions/14499320/how-to-properly-setup-nginx-access-control-allow-origin-into-response-header-bas # map $http_origin $cors_header { default ""; ~*^https://([^/]+\.)*(domainone|domaintwo)\.com$ $http_origin; } # # Redirect all www to non-www # server { listen 80; listen 443 ssl; server_name www.example.com; ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; return 301 https://example.com$request_uri; } # # Redirect all non-encrypted to encrypted # server { listen 80; server_name example.com; return 301 https://example.com$request_uri; } # # There we go # server { listen 443 ssl http2; server_name example.com; ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem; ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem; access_log /var/log/nginx/log/example.com.access.log main; error_log /var/log/nginx/log/example.com.error.log; location / { add_header Access-Control-Allow-Origin "$cors_header" always; add_header Access-Control-Allow-Methods "GET, POST, PATCH, OPTIONS" always; add_header Access-Control-Allow-Headers "Content-Type" always; add_header Strict-Transport-Security "max-age=31536000" always; add_header X-Frame-Options deny; proxy_pass http://localhost:3000; proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; proxy_redirect off; proxy_buffering off; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } }
24 Uncategorized
- /uses - A list of
/uses
pages detailing developer setups, gear, software and configs - mayswind/ AriaNg-Native - A better aria2 desktop frontend than AriaNg, containing all features of AriaNg and has more features for desktop
- Calendarpedia - Your source for calendars
以下为一则清单,包含信息资讯、工具推荐、使用教程、生活感悟、每周一书等,旨在将你引向独立思考 和客观理性。我会持续更新和维护,也可以视作本人的「废话集」和 eBooksPlan 公众号文集的备份