Skip to content

Instantly share code, notes, and snippets.

贺韦 chinaHewei

View GitHub Profile
chinaHewei / gist:b6e71e10b74cc6cda286438a2ad61cf9
Created Jan 14, 2018 — forked from giannisp/gist:ebaca117ac9e44231421f04e7796d5ca
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)
View gist:b6e71e10b74cc6cda286438a2ad61cf9
After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work.
The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."
Database files have to be updated before starting the server, here are the steps that had to be followed:
# need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install postgresql@9.6
brew unlink postgresql@9.6
brew link postgresql
chinaHewei / swap.js
Created Jan 4, 2018
JavaScript interesting code
View swap.js
let a = 2
let b = 1
console.log(`a --> ${a}\nb --> ${b}`)
// swap a and b
a = {x: b, y: (b = a)}.x
console.log(`a --> ${a}\nb --> ${b}`)
chinaHewei / 201801-学习计划.md
Last active Jan 6, 2018
2018 年一月份学习计划
View 201801-学习计划.md
You can’t perform that action at this time.