This file contains 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
// get line separated list without whitespace, newline, carriage return characters | |
const fs = require('fs'); | |
const path = require('path'); | |
const DIR_PATH = path.resolve(__dirname,'../subdirectory') | |
const list = fs.readFileSync(`${DIR_PATH}/list_to_read.txt`, "utf-8").split("\n").map(i => i.replace(/(\r\n|\n|\r)/gm, "")) |
This file contains 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
-- list tables by size | |
select schemaname as table_schema, | |
relname as table_name, | |
pg_size_pretty(pg_total_relation_size(relid)) as total_size, | |
pg_size_pretty(pg_relation_size(relid)) as data_size, | |
pg_size_pretty(pg_total_relation_size(relid) - pg_relation_size(relid)) | |
as external_size | |
from pg_catalog.pg_statio_user_tables | |
order by pg_total_relation_size(relid) desc, | |
pg_relation_size(relid) desc |
This file contains 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
# cheat_sheet.org.sh | |
# The contents of this file are released under the GNU General Public License. Feel free to reuse the contents of this work, as long as the resultant works give proper attribution and are made publicly available under the GNU General Public License. | |
# Best viewed in emacs org-mode. | |
# Alternately, one can keep this cheat sheet handy by adding the following line to ~/.bashrc: | |
# | |
# alias cheatsheet="less ~/path_to_cheat_sheet.org.sh" | |
* Reference: | |
** Basics: |
This file contains 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 path = require('path'); | |
const PATHS = { | |
src: path.join(__dirname, './src'), | |
public: path.join(__dirname, './public') | |
}; | |
var config = { | |
entry: { | |
app: [ 'babel-polyfill', path.resolve(PATHS.src, 'index.js') ] |