Skip to content

Instantly share code, notes, and snippets.

iver /
Created Jun 2, 2021 — forked from tomysmile/
Brew install Redis on Mac

type below:

brew update
brew install redis

To have launchd start redis now and restart at login:

brew services start redis
iver / nginx.cors.conf
Last active Jul 8, 2021 — forked from Stanback/nginx.conf
Example Nginx configuration for adding cross-origin resource sharing (CORS) support to reverse proxied APIs
View nginx.cors.conf
# CORS header support
# One way to use this is by placing it into a file called "global/cors.conf"
# under your Nginx configuration directory and placing the following
# statement inside your **location** block(s):
# include global/cors.conf;
# As of Nginx 1.7.5, add_header supports an "always" parameter which
iver / .drone.yml
Created Jun 11, 2020 — forked from wzulfikar/.drone.yml
Drone CI slack template. more on + slack integration:
View .drone.yml
image: alpine
- echo "do something :v"
image: plugins/slack
channel: dev__builds
iver / phoenix_to_umbrella
Last active Nov 9, 2019 — forked from emilsoman/phoenix_to_umbrella
How to move an existing phoenix app under an umbrella app
View phoenix_to_umbrella
How to convert existing phoenix app to an umbrella app.
chrismccord [10:14 PM]
@alanpeabody yes, it's straightforward
1) mix new my_umbrella --umbrella
iver / Flatten
Last active May 1, 2019
A sample of implementation
View Flatten

Sorry if I don't put only the code here but the instructions says:

When writing this code, you can use any language you're comfortable with. 

* The code must be well tested ...
* ... documented if necessary
* ... treat the quality of the code as if it was ready to ship to production.

So, I think the best way to do that is using a git repository.

iver /
Last active Mar 8, 2019 — forked from robphoenix/
Spacemacs Cheat Sheet

Useful Spacemacs commands

  • SPC q q - quit
  • SPC w / - split window vertically
  • SPC w - - split window horizontally
  • SPC 1 - switch to window 1
  • SPC 2 - switch to window 2
  • SPC w c - delete current window
  • SPC TAB - switch to previous buffer
  • SPC b b - switch buffers
iver /
Last active Sep 14, 2020 — forked from Kartones/
PostgreSQL command line cheatsheet


Magic words:

$ psql -U postgres


$ sudo -u postgres psql
iver /
Last active Jun 7, 2018 — forked from giannisp/gist:ebaca117ac9e44231421f04e7796d5ca
Upgrade PostgreSQL 9.6.5 to 10.0 using Homebrew (macOS)

NOTES: After automatically updating Postgres to 10.0 via Homebrew, the pg_ctl start command didn't work. The error was "The data directory was initialized by PostgreSQL version 9.6, which is not compatible with this version 10.0."

Database files have to be updated before starting the server, here are the steps that had to be followed:

  • Need to have both 9.6.x and latest 10.0 installed, and keep 10.0 as default
brew unlink postgresql
brew install postgresql@9.6
brew unlink postgresql@9.6
iver / postgres_queries_and_commands.sql
Last active Jan 21, 2020 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
View postgres_queries_and_commands.sql
-- 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%'
iver /
Last active Nov 16, 2017
Validate SSL Certificate from command line

Determine SSL cert expiration date from a PEM file:

$ openssl x509 -enddate -noout -in file.pem

Check many files:

for pem in /etc/ssl/certs/*.pem; do