Skip to content

Instantly share code, notes, and snippets.

git checkout --orphan TEMP_BRANCH && git add -A && git commit -am "Initial commit" && git branch -D master && git branch -m master && git push -f origin master && git branch --set-upstream-to=origin/master master && git pull
git rm -r --cached . && git add . && git commit -m "fixed untracked files" && git push
if certbot fail, get free ssl from https://freessl.cn/
<VirtualHost *:80 *:443>
ServerName www.853rd.com
ServerAlias 853rd.com
ServerAdmin sten.li@foxmail.com
DocumentRoot /var/www/853rd.com
<Directory "/var/www/853rd.com/">
Options Indexes FollowSymLinks
sudo gpt -r show disk0 ->
Mackintosh HD part is 234045360 blob => 234045360*512 = 119831224320 B = 119.83122432 GB
***
How to convert between Gigabytes and Gibibytes (GB & GiB)?
1 GB = 0.931322574615 GiB
1 GiB = 1.073741824 GB
***
Apple prefers GB while Microsoft prefers GiB, for example I want a perfact Windows partision with size of 50.00G(from the view of Windows) on my Mac:
{
"server": "0.0.0.0",
"local_address": "127.0.0.1",
"local_port": 1080,
"port_password": {
"8850": "0",
"8851": "1",
"8852": "2",
"8853": "3"
},
@1isten
1isten / vue naming
Last active October 25, 2020 02:25
my naming preferences
PascalCase:
- component file name (best practice)
e.g.
"Foo.vue"
"FooBar.vue"
- component name (match the file name, for default export)
e.g.
export default {
name: 'Foo',
@1isten
1isten / ascii2svg2base64
Created September 25, 2019 15:36
use ascii art for markdown
brew install rust
cargo install svgbob_cli
~/.cargo/bin/svgbob -h
~/.cargo/bin/svgbob --font-family monospace ascii.txt -o ascii.svg
base64 -i ascii.svg | pbcopy
@1isten
1isten / settings.json
Last active March 27, 2022 16:14
VS Code settings
{
"editor.tabSize": 2,
"editor.cursorStyle": "block",
"editor.cursorBlinking": "smooth",
"editor.cursorSmoothCaretAnimation": true,
"editor.bracketPairColorization.enabled": true,
"editor.detectIndentation": true,
"editor.formatOnPaste": true,
"editor.formatOnSave": false,
"explorer.compactFolders": false,
@1isten
1isten / css.json
Last active April 8, 2020 14:08
VS Code CSS snippets
{
"General reset": {
"prefix": "reset",
"body": [
"html, $2body {",
" width: 100vw;",
" height: 100vh;",
" margin: 0;",
" border: 0;",
" padding: 0;",
@1isten
1isten / javascript.json
Last active September 26, 2020 06:27
VS Code CSS snippets
{
"esdisable": {
"prefix": "esdis",
"body": [
"// eslint-disable-next-line "
],
"description": "eslint-disable-next-line"
}
}