Skip to content

Instantly share code, notes, and snippets.

Avatar

Pedro Paulo Jr ppaulojr

View GitHub Profile
@ppaulojr
ppaulojr / Documentação Integração Trademap.md
Last active Aug 22, 2019
Documentação Integração Trademap
View Documentação Integração Trademap.md

Processo de Credenciamento

  1. Parceiro vai cadastrar uma URL de callback (enviar para nós por e-mail)
  2. Parceiro receberá um client_id e um client_sercret (enviaremos por e-mail)

Solicitar autorização do usuário

URL_ORAMA/parceiros/solicitacao/

Dados passados via HTTP GET:

View postmon.json
{
"openapi" : "3.0.2",
"info" : {
"title" : "Postmon",
"description" : "Uma API para consultar CEP",
"version" : "1.0.0"
},
"servers" : [ {
"url" : "https://api.postmon.com.br/v1/"
} ],
View convert.py
# input bitset array
# output position of the bits that are 1
def parse_string_netfilter(s):
lista = s.split(",")
resp = []
for i,x in enumerate(lista):
b = "{:b}".format(int(x))[::-1]
resp = resp + [int(j)+1+8*int(i) for j,y in enumerate(b) if y=="1"]
return resp
@ppaulojr
ppaulojr / stockfish.sh
Created Mar 5, 2017 — forked from notbanker/stockfish.sh
Use stockfish engine to output the position evaluation only
View stockfish.sh
#!/usr/bin/env bash
# Call stockfish engine on mac and return only the evaluation score
# Usage stockfish.sh 'r1b2rk1/4qppp/2pp4/pp6/3Bn3/PB3Q1P/1PP2PP1/3R1RK1' 5 mac 12 1024
# Usage stockfish.sh 'r1b2rk1/4qppp/2pp4/pp6/3Bn3/PB3Q1P/1PP2PP1/3R1RK1' 5 mac 12 1024
# Assumes the stockfish binary is called 'stockfish_'+binary
fen=$1
seconds=${2:-3}
binary=${3:-mac}
threads=${4:-12}
View realm.md

Why it seemed that Realm was slower

Actually Realm is much faster than Core Data

Instrumenting the code

- (void)createOrUpdateStaffRoundablesWithResponse:(NSArray<CHResponseRoundableMemberStaff *> *)response
{
    TICK(FOR_TIME);
View checklist.json
{
"id" : "00000004",
"last_updated_at" : "02-08-2016",
"sections" : [ {
"items" : [ {
"id" : "00000023",
"text" : "Wear mask (if required)",
"type" : "simple"
}, {
"id" : "00000024",
View gist:dd2b854ce95e715a501d08821f1a4e1b
You can’t perform that action at this time.