This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##Setting up eslint and tests running before each commit. | |
1. `npm install --save-dev husky` | |
2. `npm install --save-dev lint-staged` | |
4. Add husky config to run lint-staged script before every commit | |
``` | |
"husky": { | |
"hooks": { | |
"pre-commit": "lint-staged" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
##Full vacuum of postgres daatabase | |
#docs https://www.postgresql.org/docs/9.5/static/app-vacuumdb.html | |
/usr/local/bin/vacuumdb -h [postgres_server_host] -U [username] -d [database] -fze |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- show running queries (pre 9.2) | |
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query | |
FROM pg_stat_activity | |
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%' | |
ORDER BY query_start desc; | |
-- show running queries (9.2) | |
SELECT pid, age(query_start, clock_timestamp()), usename, query | |
FROM pg_stat_activity | |
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- kill running query | |
SELECT pg_cancel_backend(procpid); | |
-- kill idle query | |
SELECT pg_terminate_backend(procpid); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const condition = { | |
test: this.sequelize.literal( | |
`timezone('UTC', modified::timestamptz) > '${moment( | |
this.config.last_parse, | |
).format('YYYY-MM-DD HH:mm:ss +00:00')}'`, | |
), | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//view all blocking locks | |
SELECT | |
* | |
FROM | |
pg_locks pl | |
LEFT JOIN pg_stat_activity psa ON pl.pid = psa.pid | |
WHERE | |
wait_event_type = 'Lock' AND pl.pid <> pg_backend_pid() | |
ORDER BY | |
query_start ASC |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### 1. Clone your fork: | |
git clone [email protected]:YOUR-USERNAME/YOUR-FORKED-REPO.git | |
### 2. Add remote from original repository in your forked repository: | |
cd into/cloned/fork-repo | |
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git | |
git fetch upstream |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// assuming a var named `buffer` exists and is an AudioBuffer instance | |
// start a new worker | |
// we can't use Recorder directly, since it doesn't support what we're trying to do | |
var worker = new Worker('recorderWorker.js'); | |
// initialize the new worker | |
worker.postMessage({ | |
command: 'init', |
NewerOlder