Skip to content

Instantly share code, notes, and snippets.

View imansprn's full-sized avatar
💊

Iman imansprn

💊
View GitHub Profile
package middleware
import (
"context"
"fmt"
"github.com/go-chi/chi/middleware"
"github.com/rs/zerolog"
"net/http"
"time"
)
@imansprn
imansprn / install_pg_gem.md
Created August 23, 2022 13:12 — forked from tomholford/install_pg_gem.md
Install postgresql gem `pg` on macOS

Installing pg gem on macOS

If you're trying to install the postgresql gem pg and it is failing with the following error message:

Installing pg 1.2.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: ~/.rbenv/versions/3.0.0/lib/ruby/gems/3.0.0/gems/pg-1.2.3/ext
~/.rbenv/versions/3.0.0/bin/ruby -I ~/.rbenv/versions/3.0.0/lib/ruby/3.0.0 -r ./siteconf20210125-97201-pycpo.rb extconf.rb
@imansprn
imansprn / example.com
Created April 25, 2021 17:40
Basic Configuration for an NGINX Reverse Proxy
server {
listen 80;
server_name example.com;
location / {
proxy_pass http://localhost:3000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-Proto https;
@imansprn
imansprn / default
Created April 25, 2021 17:13
Nginx default virtual host
##
# You should look at the following URL's in order to grasp a solid understanding
# of Nginx configuration files in order to fully unleash the power of Nginx.
# https://www.nginx.com/resources/wiki/start/
# https://www.nginx.com/resources/wiki/start/topics/tutorials/config_pitfalls/
# https://wiki.debian.org/Nginx/DirectoryStructure
#
# In most cases, administrators will remove this file from sites-enabled/ and
# leave it as reference inside of sites-available where it will continue to be
# updated by the nginx packaging team.
@imansprn
imansprn / deploy.yml
Created April 25, 2021 17:10
Laravel deployer on Github Action
name: Deploy
on:
push:
branches: [ master ]
jobs:
Deploy:
runs-on: ubuntu-latest
@imansprn
imansprn / my.cnf
Created February 2, 2021 14:49 — forked from Tanguy-SALMON/my.cnf
Percona Server 8.0 configuration file
#
# The MySQL database server configuration file.
#
# You can copy this to one of:
# - "/etc/mysql/my.cnf" to set global options,
# - "~/.my.cnf" to set user-specific options.
#
# One can use all long options that the program supports.
# Run program with --help to get a list of available options and with
# --print-defaults to see which it would actually understand and use.
@imansprn
imansprn / fix-missing-libcrypto-osx.md
Created June 21, 2020 18:04 — forked from aklap/fix-missing-libcrypto-osx.md
Resolving missing link to libcrypto/openssl on OSX