Skip to content

Instantly share code, notes, and snippets.

View rodrigo-brito's full-sized avatar
🇧🇷
You are what you share

Rodrigo Brito rodrigo-brito

🇧🇷
You are what you share
View GitHub Profile
package refdiff.examples;
import java.io.File;
import refdiff.core.RefDiff;
import refdiff.core.diff.CstDiff;
import refdiff.core.diff.Relationship;
import refdiff.parsers.go.GoPlugin;
public class RefDiffExampleGo {
@rodrigo-brito
rodrigo-brito / binance_ccxt.py
Created July 28, 2019 22:16
CCXT - Binance example of usage
class Binance:
def __init__(self, key, secret, test=False):
self.exchange = ccxt.binance({
'apiKey': key,
'secret': secret,
'enableRateLimit': True,
})
self.test = test
def buy(self, symbol, amount):
@rodrigo-brito
rodrigo-brito / reverse_proxy.go
Created October 18, 2018 11:10
Go reverse proxy
package main
import (
"fmt"
"net/http"
"net/http/httputil"
"net/url"
)
func main() {
@rodrigo-brito
rodrigo-brito / caddyproxy_mkcert.Caddyfile
Created October 18, 2018 11:08
Caddy proxy with HTTPS - Mkcert
id.cifraclub.com.br {
log stdout
# Mkcert - https://github.com/FiloSottile/mkcert
tls ./yourwebsite.com.br.pem ./yourwebsite.com.br-key.pem
proxy / https://yourwebsite.com {
transparent
header_upstream X-Marotagem true
header_upstream Host "yourwebsite.com.br"
}
"terminal.integrated.fontFamily": "Source Code Pro for Powerline",
"git.autofetch": false,
"go.formatTool": "goimports",
"go.lintOnSave": "off",
"go.gotoSymbol.includeImports": true,
"go.docsTool": "gogetdoc",
"go.useLanguageServer": true,
"go.gocodeAutoBuild": true,
"go.buildOnSave": "package",
"go.useCodeSnippetsOnFunctionSuggest": true,
#!/bin/sh
ROOT_DIR=/var/www/project
GIT_WORK_TREE=$ROOT_DIR git checkout -f
cd $ROOT_DIR
./post-receive
inFile, _ := os.Open(path)
defer inFile.Close()
scanner := bufio.NewScanner(inFile)
scanner.Split(bufio.ScanLines)
for scanner.Scan() {
line := fscanner.Text()
}
# List of files filtered by other file
git ls-files | grep -Fv -f ignore.txt
version: '3.1'
services:
mysql:
image: mysql:5.7
environment:
MYSQL_ROOT_PASSWORD: root
phpmyadmin:
image: phpmyadmin/phpmyadmin
depends_on:
query {
repository(owner: "rodrigo-brito", name: "json-to-go-map"){
ref(qualifiedName: "master") {
target {
... on Commit {
id
history(first: 10, since: "2017-09-10T20:58:37.000-03:00") {
edges {
node {
messageHeadline