Skip to content

Instantly share code, notes, and snippets.

View zivanovicb's full-sized avatar
👋

Branko Zivanovic zivanovicb

👋
View GitHub Profile
@zivanovicb
zivanovicb / nginx.conf
Created February 8, 2019 13:38
nginx to serve react app
# auto detects a good number of processes to run
worker_processes auto;
#Provides the configuration file context in which the directives that affect connection processing are specified.
events {
# Sets the maximum number of simultaneous connections that can be opened by a worker process.
worker_connections 8000;
# Tells the worker to accept multiple connections at a time
multi_accept on;
}
@zivanovicb
zivanovicb / gist:56e7a5c83bfc31f2973cdf2c897c1cbf
Created July 20, 2019 12:58
start postgres on arch/manjaro
sudo chown -R postgres:postgres /var/lib/postgres/
sudo mkdir /run/postgresql
sudo chown postgres:postgres /run/postgresql
sudo -iu postgres
pg_ctl -D /var/lib/postgres/data -l logfile start
@zivanovicb
zivanovicb / postgres-brew.md
Created November 30, 2019 23:44 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
@zivanovicb
zivanovicb / postgres-cheatsheet.md
Created December 1, 2019 00:06 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@zivanovicb
zivanovicb / .js
Created February 3, 2020 11:03
ConnectedComponent
const mapStateToProps = (state, { data }) => {
return {
data: IpqsSelectors.selectLastEntry(state),
isRequestingOne: !!RequestSelectors.selectInProgress(state, [IpqsAction.GET_ONE.REQUEST])
}
}
const mapDispatchToProps = (dispatch) => ({
requestOne: async (email) => dispatch(IpqsAction.requestOne(email))
})