Skip to content

Instantly share code, notes, and snippets.

@londerson
londerson / main.rs
Last active November 15, 2023 18:36
#![allow(dead_code)]
#![allow(unused_variables)]
#![allow(unused_mut)]
#![allow(unreachable_code)]
#![allow(non_camel_case_types)]
use std::env;
use std::fs;
const UNSIGNED_32: &str = "u32";
conf = Nps::Configuration.new
conf.environment = Nps::Environments::PRODUCTION_ENV
conf.logger = Logger.new(STDOUT)
conf.log_level = Logger::INFO
conf.key = 'sUut1ojgM6jEbFpqDDj4FQFNRpow6TPWCKeeYWEh5U1mtgYsH3elGBKLsHGBba5K'
nps_sdk = Nps::Sdk.new(conf)
response = nil
payment_ids = [1393840020,
1393871970,
# Write a function that returns true if the brackets in a given string are balanced.
# Balanced means that every parenthesis/bracket or brace that is opened must be closed
# And it must be closed in the right order (Always close the last symbol you opened)
# The function must handle parens (), square brackets [], and curly braces {}.
def balanced_brackets(text)
end
# "(a[0]+b[2c[6]]) {24 + 53}" should return true
require 'csv'
module PostgresCopy
# ActAsCopyTarget é um nome estranho, além disso se seguirmos a hierarquia dos namespaces
# PostgresCopy::ActAsCopyTarget repete o sentido do módulo anterior, sugiro PostgresCopy::Target, pois funciona melhor sendo mais
# coeso, claro e simples de entender.
module Target
extend ActiveSupport::Concern
@londerson
londerson / cpp
Created October 6, 2020 15:58
Install GTest
Start from v1.8.0 gmock is included in the release file.
Here is the general steps for installing gtest and gmock in v1.8.0 - v1.10.0. (Feel free to replace 1.10.0 with your desired version.)
# download release file and extract files from it
curl -LOk https://github.com/google/googletest/archive/release-1.10.0.tar.gz
tar -zxvf release-1.10.0.tar.gz
rm release-1.10.0.tar.gz
cd googletest-release-1.10.0/