Thanks to the original blog post: https://equimper.com/blog/how-to-setup-tailwindcss-in-phoenix-1.4
cd assets
npm i --save-dev tailwindcss postcss-loader postcss-import
Thanks to the original blog post: https://equimper.com/blog/how-to-setup-tailwindcss-in-phoenix-1.4
cd assets
npm i --save-dev tailwindcss postcss-loader postcss-import
#!/bin/bash | |
# CSV to JSON converter using BASH | |
# original script from http://blog.secaserver.com/2013/12/convert-csv-json-bash/ | |
# thanks SecaGuy! | |
# Usage ./csv2json.sh input.csv > output.json | |
input=$1 | |
[ -z $1 ] && echo "No CSV input file specified" && exit 1 | |
[ ! -e $input ] && echo "Unable to locate $1" && exit 1 |
This guide was written because I don't particularly enjoy deploying Phoenix (or Elixir for that matter) applications. It's not easy. Primarily, I don't have a lot of money to spend on a nice, fancy VPS so compiling my Phoenix apps on my VPS often isn't an option. For that, we have Distillery releases. However, that requires me to either have a separate server for staging to use as a build server, or to keep a particular version of Erlang installed on my VPS, neither of which sound like great options to me and they all have the possibilities of version mismatches with ERTS. In addition to all this, theres a whole lot of configuration which needs to be done to setup a Phoenix app for deployment, and it's hard to remember.
For that reason, I wanted to use Docker so that all of my deployments would be automated and reproducable. In addition, Docker would allow me to have reproducable builds for my releases. I could build my releases on any machine that I wanted in a contai
-- Save without header | |
copy ((select "name", "email from "user") to '/absolute-path-to-directory/filename.csv' delimiter ',' csv; | |
-- Save with header | |
copy ((select "name", "email from "user") to '/absolute-path-to-directory/filename.csv' delimiter ',' csv header; | |
-- When having issue `must be superuser or a member of pg_write_server_files role COPY to a file`, add a `\` in front of `copy` | |
\copy ((select "name", "email from "user") to '/absolute-path-to-directory/filename.csv' delimiter ',' csv; |
""" Optixal's Neovim Init.vim | |
""" Vim-Plug | |
call plug#begin() | |
" Aesthetics - Main | |
Plug 'dracula/vim', { 'commit': '147f389f4275cec4ef43ebc25e2011c57b45cc00' } | |
Plug 'junegunn/goyo.vim' | |
Plug 'junegunn/vim-journal' | |
Plug 'junegunn/rainbow_parentheses.vim' |
# backup db | |
psql reforecast < prod.sql | |
# restore db |
module.exports = { | |
"env": { | |
"node": true, | |
"es6": true | |
}, | |
"globals": { | |
"request": true, | |
"app": true, | |
"expect": true, | |
"describe": true, |
syntax enable | |
set tabstop=2 | |
set number | |
set expandtab | |
set softtabstop=2 | |
set shiftwidth=2 | |
set cursorline | |
set showmatch | |
set autoindent | |
set smartindent |
Download a single file from a remote ftp server to your machine: | |
sftp username@hostname:remoteFileName localFileName | |
Upload a single file from your machine to a remote ftp server: | |
sftp {user}@{host}:{remote_dir} <<< $'put {local_file_path}' |