Skip to content

Instantly share code, notes, and snippets.

View alissonperez's full-sized avatar

Alisson R. Perez alissonperez

  • São Paulo, SP, Brasil
View GitHub Profile
REPLICAS_COUNT=$(kubectl -s $K8S_CLUSTER --token=$K8S_TOKEN -n $NAMESPACE get pods -l app=$YOUR_APP | grep -i running | wc -l | grep -oE "[0-9]+")
if [ $REPLICAS_COUNT -eq 0 ]; then
REPLICAS_COUNT=2
fi
REPLICAS_COUNT=$REPLICAS_COUNT envsubst < deploy/your-deployment.yaml.template > your-deployment.yaml
@thurt
thurt / revprox.go
Last active August 5, 2024 21:07 — forked from JalfResi/revprox.go
Simple reverse proxy in Go (forked from original to use a struct instead of a closure)
package main
import(
"log"
"net/url"
"net/http"
"net/http/httputil"
)
func main() {
@foklepoint
foklepoint / .gitlab-ci.yml
Created July 8, 2017 20:25
Build and Push images to GCP Container Registry with Gitlab CI
image: docker:latest
# When using dind, it's wise to use the overlayfs driver for
# improved performance.
variables:
DOCKER_DRIVER: overlay
GCP_PROJECT_ID: CHANGE-TO-GCP-PROJECT-ID
IMAGE_NAME: image_id
services:
@tonyfabeen
tonyfabeen / avl.rb
Created March 3, 2017 11:53
Avl Tree in Ruby
# Node
class Node
attr_accessor :value,
:height,
:left,
:right
def initialize(value = nil, height = 0)
@value = value
@height = height
@AlanHohn
AlanHohn / makecsv.py
Created January 19, 2017 13:59
Generate a random CSV in Python
#!/usr/bin/python
import csv
import random
records=9000000
print("Making %d records\n" % records)
fieldnames=['id','name','age','city']
writer = csv.DictWriter(open("people.csv", "w"), fieldnames=fieldnames)
@celisflen-bers
celisflen-bers / README.md
Last active March 11, 2022 11:45 — forked from bertspaan/README.md
Python script to convert DBF database file to CSV
1. Build GraphQL server using `express-graphql` package.
2. Configure `schema.js` file.
3. Query for data.
@yowu
yowu / HttpProxy.go
Last active August 21, 2024 05:06
A simple HTTP proxy by Golang
package main
import (
"flag"
"io"
"log"
"net"
"net/http"
"strings"
)
@erikhenrique
erikhenrique / bin-cc.md
Last active June 30, 2024 22:14
Bin de cartões de crédito para validação

Validação para cartão de crédito.

Bin e padrões para validação de cartão de crédito.

Bandeira Começa com Máximo de número Máximo de número cvc
Visa 4 13,16 3
Mastercard 5 16 3