Skip to content

Instantly share code, notes, and snippets.

View douglasmiranda's full-sized avatar
👽

Douglas Miranda douglasmiranda

👽
  • Earth, Brazil
View GitHub Profile
# Based on https://www.pgday.ch/common/slides/2017_ver6_pgbouncer_20k_English.pdf
# Just connect to pgbouncer like you would connect to a postgres server
# In this case using the port 6432
# Run pgbouncer as the user pgbouncer (su-exec)
[databases]
db1 = host=postgres port=5432 dbname=db1
[pgbouncer]
listen_addr = *
listen_port = 6432
@douglasmiranda
douglasmiranda / nginx.conf
Created May 4, 2018 01:00 — forked from nrollr/nginx.conf
NGINX config for SSL with Let's Encrypt certs
# Advanced config for NGINX
server_tokens off;
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options nosniff;
# Redirect all HTTP traffic to HTTPS
server {
listen 80;
server_name www.domain.com domain.com;
return 301 https://$host$request_uri;
while ! pg_isready > /dev/null 2> /dev/null; do echo "Connecting to postgres failed"; sleep 1; done
$ pipenv install gconfigs # or pip install gconfigs
$ pipenv run python
>>> from gconfigs import envs, configs, secrets
>>> envs('HOME', default='/')
'/'
>>> configs.as_bool('DEBUG', default=False)
False
>>> configs('DATABASE_USER')
@douglasmiranda
douglasmiranda / megamenu.html
Created February 2, 2018 00:01
Bootstrap Mega Menu Example
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Document</title>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/css/bootstrap-material-design.min.css" integrity="sha384-R80DC0KVBO4GSTw+wZ5x2zn2pu4POSErBkf8/fSFhPXHxvHJydT0CSgAP2Yo2r4I" crossorigin="anonymous">
<style>
#mega-menu {
margin-top: 50px;
@douglasmiranda
douglasmiranda / pdf-to-svg.md
Last active March 21, 2025 17:23
About PDF to SVG converters

Update in 2024

In 2024 I'm actually having a good time using mupdf.

About my experience with mupdf:

It's written in C, but you can use it in many ways. Command line, python lib (pymupdf), js, and others.

I still coundn't find issues that I had with other tools and weird broken PDFs, so I'd say pretty good.

@douglasmiranda
douglasmiranda / svg-optimizers.md
Last active April 12, 2024 14:35
About SVG Optimizers
@douglasmiranda
douglasmiranda / install.sh
Last active October 23, 2019 02:26
After Install Ubuntu 17.10 - Chrome, Fish Shell, Docker, Docker Compose
sudo apt update
sudo apt upgrade -y
# Remember: install / verify additional drivers
sudo sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list'
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo apt update
# google chrome and chrome extension to use gnome extensions

Keybase proof

I hereby claim:

  • I am douglasmiranda on github.
  • I am douglasmiranda (https://keybase.io/douglasmiranda) on keybase.
  • I have a public key whose fingerprint is F99B 7508 C1AE 1A2C B575 6FF9 45B8 D780 7808 D37C

To claim this, I am signing this object:

@douglasmiranda
douglasmiranda / disable.sh
Created November 7, 2017 21:38
Disable Advanced Power Management for external drive
sudo hdparm -B 255 /dev/sdX