Skip to content

Instantly share code, notes, and snippets.

View Titowisk's full-sized avatar
💭
☕️ 💻

Vitor R. F. Ribeiro Titowisk

💭
☕️ 💻
  • Kinvo
  • Salvador, Bahia - Brasil
View GitHub Profile
@Titowisk
Titowisk / BenchmarkValidationTest.cs
Created May 9, 2021 14:35
ExceptApproach x AnyApproach
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using System;
using System.Collections.Generic;
using System.Linq;
namespace ExceptAproachXAnyAproach
{
class Program
{
@Titowisk
Titowisk / searchAndOpenReports.js
Created March 25, 2019 18:45
searchAndOpenReports.js from my nw.js
/**Search and Open Reports
* Este algoritmo serve para ler as informações de laudo direto do arquivo.csv
* que gera eles e assim fornecer a funcionalidade de busca ao usuário.
* Dessa forma o usuário pode buscar por um laudo de forma geral.
*/
// ==========================================
//============ Funções ======================
// ==========================================
@Titowisk
Titowisk / template.html
Last active March 25, 2019 18:45
template html nw.js
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<!-- Fonts -->
<link rel="stylesheet" href="../../assets/css/open-sans.css">
<section class="table">
<div class="table__topHeader">
<div class="filter__clear">
<button type="button" aria-label="Left Align">
Limpar Filtros
<span class="glyphicon glyphicon-remove" aria-hidden="true"></span>
</button>
</div>
<div class="table__title">
@Titowisk
Titowisk / sec.py
Last active December 20, 2018 18:05
Sequencial Error Calculator
import random
number_of_tries = 1000
number_of_sequencial_errors = 4
error_values = [7,8,9,10] # the condition of unwanted number
percentage = (10 - len(error_values))/10 * 100
previous = False # save the previous generated number
condition = 0 # verifies when the error happens 3 times
count = 0 # counts the number of times the error happens 3 times in a row
total = 0
import random
sorteio = set()
def gerar_mega():
while len(sorteio) <= 5:
d = random.randint(1, 60)
sorteio.add(d)
print(sorted(sorteio))
@Titowisk
Titowisk / mega_sena2.py
Created August 25, 2017 21:01
Programa anterior(mega_sena.py) otimizado em menos linhas de código.
# coding: utf-8
# Aplicativo de na mega sena.
import random
sorteio = []
def gerar_mega2():
while len(sorteio) <= 5:
d = random.randint(1, 60)
@Titowisk
Titowisk / mega_sena.py
Last active August 10, 2017 18:50
Pequeno programa que sorteia as 6 dezenas da mega-sena. (Just a little code that generates six numbers to a lottery here in brazil).
# coding=utf-8
#Aplicativo de apostas na mega sena.
# Autor: Vitor RFR
import random
def gerar_mega():
dezenas = []
#Irá gerar as 6 dezenas da mega sena.
for a in range(6):