Skip to content

Instantly share code, notes, and snippets.

@WesleyBatista
WesleyBatista / blockly.xml
Created September 15, 2021 20:02
New Marlowe Project
When
[Case
(Deposit
(Role "Seller")
(Role "Buyer")
(Token "" "")
(ConstantParam "Price")
)
(When
[Case
@WesleyBatista
WesleyBatista / README.md
Last active November 1, 2021 14:51 — forked from antonydevanchi/README.md
Download all images from undraw.co/illustrations
package main
import (
"fmt"
)
type Base interface {
SetParams(string)
GetParams() string
}
import clickhouse_driver
def execute_query(sql, settings):
conn_params = {
'host': '<HOST>',
'port': 9000,
'user': '<USER>',
'password': '<PASSWORD>',
'database': 'default',
@WesleyBatista
WesleyBatista / raspberry_databases.md
Last active September 1, 2019 15:12
Running the main databases on raspberry pi

setup

mongo

  1. create the data dir mkdir -p /home/pi/mongo/data
  2. run the following docker command:
    docker run --restart always -d -p 27017:27017 -p 28017:28017 -e AUTH=no -v /home/pi/mongo/data:/data/db --name mongo izone/arm:mongo-3.0.9
    

    source: https://github.com/luvres/armhf

import dateutil.parser
dates = [
# dates that comes as str from kafka message:
'2019-05-27T12:54:28.777652636Z',
'2019-05-27T12:54:28.128Z', # added
'2019-05-27T12:54:28.120Z', # added
'2019-05-27T12:54:28.100Z', # added
'2019-05-27T12:54:28.1Z', # added
'2019-05-27T12:54:29.993908166Z',
@WesleyBatista
WesleyBatista / 20181217_cockroach_bigserial_bigint_quick_study.md
Created December 17, 2018 14:27
Cockroach Bigserial and Bigint compatibility - Quick Study

Is the bigserial compatible with the bigint on Cockroach?

Create the tables

Let's create table_x with a bigserial column and set it as the primary key.

CREATE TABLE table_x (
	id bigserial PRIMARY KEY, 
@WesleyBatista
WesleyBatista / consumer.py
Last active June 16, 2018 00:42
Kafka 0.11.0.0 with kafka-manager running with docker-compose
import os
from kafka import KafkaConsumer
from settings import BOOTSTRAP_SERVERS, TOPIC
consumer = KafkaConsumer(TOPIC, bootstrap_servers=BOOTSTRAP_SERVERS, auto_offset_reset='earliest')
print("connected to: {}".format(BOOTSTRAP_SERVERS))
for message in consumer:
# message value and key are raw bytes -- decode if necessary!
force {
UserName = "[email protected]"
PassWord = "xxxxxxxxXXXXXXXXXXXXXXXXXXXXXXXX"
ClientID = "xxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx.xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
ClientSecret = "xxxxxxxxxxxxxxxxxxx"
InstanceUrl = "https://xxxx.salesforce.com"
DataServiceUrl = "/services/data/v41.0"
}
package com.example.salesforce
import com.google.gson.Gson
import scala.collection.mutable.{Map,
SynchronizedMap, HashMap}
case class DescribeField(name: String, `type`: String)