This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![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"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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/ |