Skip to content

Instantly share code, notes, and snippets.

View gusanthiago's full-sized avatar

Gustavo Santos Thiago gusanthiago

View GitHub Profile
#include <bits/stdc++.h>
using namespace std;
vector<string> split_string(string);
map<string, bool> queenMap;
int getSquaresInDirection(int n, int iQueen, int jQueen, pair<int, int> direction) {
const insertNewElementInOrderedArray = (orderedArray, newElement) => {
const size = orderedArray.length;
if (size === 0) {
return [newElement];
}
if (newElement < orderedArray[0]) {
orderedArray.unshift(newElement);
return orderedArray;
}
for (let i=1; i < size; i++) {
## Server
server.port=8082
server.servlet.context-path=/springRestSecurity
## Logging
# Show sql statement
logging.level.org.hibernate.SQL=debug
# Show sql values
logging.level.org.hibernate.type.descriptor.sql=trace
node('php') {
stage('Check Java version') {
sh 'java -version'
}
stage('Current time') {
sh 'date'
}
}
=__ Gerenciamento de Ambientes __
Listar os ambientes criados:
$ conda info --envs
Criar um novo ambiente:
$ conda create --name <nome> <pacote_1> <pacote_2> ...
Clonar um ambiente existente:
$ conda create --name <nome> --clone <ambiente_previamente_criado>
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <bits/stdc++.h>
using namespace std;
#define huge unsigned long long
huge mulmod(huge a, huge b, huge c)
{
huge x = 0, y = a%c;
while(b>0)
{
@gusanthiago
gusanthiago / regex-card-test.js
Created July 12, 2017 13:47
Testing credit cards
/**
* Regex credit card numbers test
*
* author <gusanthiagodv@gmail>
*/
const cardCompanies = [
{name: 'visa', pattern: /^4[0-9]{15}$/},
{name: 'master', pattern: /^5[0-5][0-9]{14}$|2[2-6][0-9]{14}$|271[0-9]{13}$|2720[0-9]{12}/},
{name: 'american_express', pattern: /^3[47][0-9]{13}$/},
{name: 'diners_club', pattern: /^3(0[0-5]|[68]\d)\d{11}$/},
@gusanthiago
gusanthiago / labels-drink.json
Last active June 21, 2017 04:19
Labels drink
{
"brands": [
{
"name":"Adriatica"
},
{
"name":"Antarctica"
},
{
"name":"Antarctica Sub Zero"
@gusanthiago
gusanthiago / novocatarata.cpp
Last active June 10, 2017 16:55
Teste mochila
#include <bits/stdc++.h>
using namespace std;
#define maxn 200010
vector <int> pesos,valores;
int c = 0;
int pd[1000100][200100];