Skip to content

Instantly share code, notes, and snippets.

View ppaulojr's full-sized avatar

Pedro Paulo Jr ppaulojr

View GitHub Profile
@ppaulojr
ppaulojr / Documentação Integração Trademap.md
Last active August 22, 2019 12:25
Documentação Integração Trademap

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:

{
"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/"
} ],
# 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 March 5, 2017 02:12 — forked from notbanker/stockfish.sh
Use stockfish engine to output the position evaluation only
#!/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}

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);
{
"id" : "00000004",
"last_updated_at" : "02-08-2016",
"sections" : [ {
"items" : [ {
"id" : "00000023",
"text" : "Wear mask (if required)",
"type" : "simple"
}, {
"id" : "00000024",