Skip to content

Instantly share code, notes, and snippets.

View raninho's full-sized avatar
🤖
Simulating what is human.

Raniere Medeiros raninho

🤖
Simulating what is human.
View GitHub Profile
@turicas
turicas / brasil_io.py
Last active August 13, 2022 23:04
Exemplo de código para acessar dados do Brasil.IO
import csv
import gzip
import io
import json
from urllib.parse import urlencode, urljoin
from urllib.request import Request, urlopen
class BrasilIO:
@alukach
alukach / app.yaml
Last active July 24, 2024 13:54
An example Github Actions for Python + Pipenv + Postgres + Pyright
# .github/workflows/app.yaml
name: My Python Project
on: push
jobs:
test:
runs-on: ubuntu-latest
timeout-minutes: 10
services:
@marcosinger
marcosinger / completions-gswitch.fish
Created October 16, 2019 19:40
Fish helpers to handle with gcloud config
# ~/.config/completions/gswitch.fish
#
# creates a variable with the name of gcloud named configurations. Ex.:
#
# ~ glist
# NAME IS_ACTIVE ACCOUNT PROJECT
# aluminium False [email protected] aluminium-123
# nickel True [email protected] nickel-001
# zinc False [email protected] zinc-project
#
package main
import (
"fmt"
"time"
"github.com/tsenart/vegeta/lib"
)
var target = vegeta.Target{
@Maqsim
Maqsim / 413-payload-too-large-fix.js
Last active October 28, 2024 21:06
HOW TO FIX "413 Payload too large" in NodeJS (Express)
const express = require('express');
const bodyParser = require('body-parser');
...
// Express 4.0
app.use(bodyParser.json({ limit: '10mb' }));
app.use(bodyParser.urlencoded({ extended: true, limit: '10mb' }));
// Express 3.0
@andrestc
andrestc / go-missing-examples.md
Last active September 26, 2021 18:49
Go std lib funcs/methods missing examples

About this

This list has the goal of helping developers interested in contributing to the Go language but are unsure of where to start. This was not generated manually so some functions and methods here may not require examples (maybe because they are too simple, e.g .String()) and some of these may only make sense in a package level example (which are not considered for this list yet). Use your best judgment and check the documentation before you open up a CL to add an example.

You should also search in gerrit for open CLs that are already adding examples.

I will try to keep this list as up to date as possible. If you find any mistakes, please comment below and I will try to fix it.

@wwek
wwek / httpsproxy.go
Created October 29, 2017 05:41
https proxy in golang
// https://medium.com/@mlowicki/http-s-proxy-in-golang-in-less-than-100-lines-of-code-6a51c2f2c38c
// #!/usr/bin/env bash
// case `uname -s` in
// Linux*) sslConfig=/etc/ssl/openssl.cnf;;
// Darwin*) sslConfig=/System/Library/OpenSSL/openssl.cnf;;
// esac
// openssl req \
// -newkey rsa:2048 \
// -x509 \
@oseiskar
oseiskar / swagger-yaml-to-html.py
Last active April 30, 2024 10:57
Converts Swagger YAML to a static HTML document (needs: pip install PyYAML)
#!/usr/bin/python
#
# Copyright 2017 Otto Seiskari
# Licensed under the Apache License, Version 2.0.
# See http://www.apache.org/licenses/LICENSE-2.0 for the full text.
#
# This file is based on
# https://github.com/swagger-api/swagger-ui/blob/4f1772f6544699bc748299bd65f7ae2112777abc/dist/index.html
# (Copyright 2017 SmartBear Software, Licensed under Apache 2.0)
#
@ethicka
ethicka / localhost-ssl-certificate.md
Last active November 14, 2024 19:53
Localhost SSL Certificate on Mac OS

🚨 2020 Update: I recommend using mkcert to generate local certificates. You can do everything below by just running the commands brew install mkcert and mkcert -install. Keep it simple!


This gives you that beautiful green lock in Chrome. I'm assuming you're putting your SSL documents in /etc/ssl, but you can put them anywhere and replace the references in the following commands. Tested successfully on Mac OS Sierra and High Sierra.

Set up localhost.conf

sudo nano /etc/ssl/localhost/localhost.conf

@meilinger
meilinger / tmux101.md
Last active February 15, 2024 10:01
tmux 101

tmux 101 - the terminal multiplexer

Why tmux?

  • Why use a terminal multiplexer?
    • Keeps your hands on the keyboard
    • Keep multiple terminals in eyeshot
    • Detach/re-attach remote session (eg. for long-running processes)
  • Like screen, but better