Phoenix 1.5 requires Elixir >= 1.7. Be sure your existing version is up to date by running elixir -v
on the command line.
$ mix archive.uninstall phx_new
$ mix archive.install hex phx_new 1.5.0
CREATE USER admin; -- create user with name 'admin' | |
ALTER USER admin WITH PASSWORD 'hello123'; -- set password | |
GRANT SELECT ON users TO admin; -- give 'select' access on 'users' table to 'admin' user | |
REVOKE SELECT ON users FROM admin; -- revoke access on 'users' table from 'admin' user | |
GRANT SELECT ON ALL TABLES IN SCHEMA public TO admin; -- give access to all tables in public schema to 'admin' user | |
REVOKE ALL ON ALL TABLES IN SCHEMA public FROM admin; -- revoke access on all tables from 'admin' user | |
DROP USER admin; |
Picking the right architecture = Picking the right battles + Managing trade-offs
func DownloadFile(filepath string, url string) error { | |
// Get the data | |
resp, err := http.Get(url) | |
if err != nil { | |
return err | |
} | |
defer resp.Body.Close() | |
// Create the file | |
out, err := os.Create(filepath) |
"build": "react-scripts build && rm -rf DIR_TO_PHX_APP/priv/static/build && mv build DIR_TO_PHX_APP/priv/static/build",
This will move your prod build files to DIR_TO_PHX_APP/priv/static/build
on build
npm run build
--- PSQL queries which also duplicated from https://github.com/anvk/AwesomePSQLList/blob/master/README.md | |
--- some of them taken from https://www.slideshare.net/alexeylesovsky/deep-dive-into-postgresql-statistics-54594192 | |
-- I'm not an expert in PSQL. Just a developer who is trying to accumulate useful stat queries which could potentially explain problems in your Postgres DB. | |
------------ | |
-- Basics -- | |
------------ | |
-- Get indexes of tables |
#!/usr/bin/env bash
if [ ! -f /tmp/linux ]; then
curl -sS https://www.linux.org.ru/ | egrep -o /tag/[0-9a-z-]+ | sed 's|/tag/||' > /tmp/linux
fi
if [ ! -f /tmp/pron ]; then
curl -sS http://www.xvideos.com/tags | egrep -o /tags/[a-z0-9-]+ | sed 's|/tags/||' > /tmp/pron
fi
How to convert existing phoenix app to an umbrella app. | |
https://elixir-lang.slack.com/archives/phoenix/p1472921051000134 | |
chrismccord [10:14 PM] | |
@alanpeabody yes, it's straightforward | |
[10:14] | |
1) mix new my_umbrella --umbrella |
Picking the right architecture = Picking the right battles + Managing trade-offs