Skip to content

Instantly share code, notes, and snippets.

@bennotti
bennotti / program.cs
Created December 16, 2023 15:46
Combinação 6 numeros C#
internal class Program
{
static void Main(string[] args)
{
var data = new List<int> { 14, 07, 50, 17, 04, 05, 12, 03 };
var valorPorAposta = 5;
var result = Combinations(data).ToList();
var qntJogos = 0;
@bennotti
bennotti / docker-nginx-proxy-manager.yml
Created July 16, 2023 15:24
docker nginx proxy manager certbot let's encrypt
version: '3.8'
services:
app:
image: 'jc21/nginx-proxy-manager:latest'
restart: unless-stopped
ports:
- '80:80'
- '81:81'
- '443:443'
volumes:
@bennotti
bennotti / CertificateGenerator.cs
Created February 11, 2023 21:35
Gerar certificado PFX
using System;
using System.Security.Cryptography;
using System.Security.Cryptography.X509Certificates;
namespace CertificateGenerator
{
class Program
{
static void Main(string[] args)
{
@bennotti
bennotti / padraoDto.cs
Last active November 25, 2022 22:04
lista campos/propriedades de uma classe
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace PocClassPropertiesList
{
public class padraoDto
{
@bennotti
bennotti / crypto_xml_a3.txt
Created November 22, 2022 13:14 — forked from abernardobr/crypto_xml_a3.txt
Example XML Crypto, using A3
var SignedXml = require('xml-crypto').SignedXml;
var FileKeyInfo = require('xml-crypto').FileKeyInfo;
LocalSchema.statics.sign = function(options, cb) {
var user = options.user;
if(user.orgId !== options.payload.orgId) {
return cb(HD.errors.unauthorizedAction, {});
}
//+------------------------------------------------------------------+
//| sample.mq5 |
//+------------------------------------------------------------------+
#property copyright "Copyright 2021, xyz"
#property link "https://www.xyz.com.br"
#define TESTE_VERSAO "1.000"// xxx.yyy
#property version TESTE_VERSAO
#property description "xyz."
#property description "xyz. "
@bennotti
bennotti / start.ts
Created July 10, 2022 14:48
[typescript] gerar 12 palavras aleatorias de 6 caracteres cada
const chunkString = (valor: string, tamanho: number): Array<string> => {
return valor.match(new RegExp('.{1,' + tamanho + '}', 'g')) as Array<string>;
}
const valor3uuid = 'bd08927cd4714fc6b8fb63d8061096c0a7eae0975910406089714028e57062d074d74b7acef344aebab676d1d08d925f';
const listaPalavras = chunkString((valor3uuid).substring(0, 72), 6);
console.log(listaPalavras);
console.log(listaPalavras.join(' '));
@bennotti
bennotti / $Running a Private Ethereum Blockchain using Docker.markdown Setup and run a cluster of nodes to build a private Ethereum network in Docker environment

Running a Private Ethereum Blockchain using Docker

Put genesis.json, Dockerfile, docker-compose.yml and .env files together in the same folder. Then run the command.

docker-compose up
@bennotti
bennotti / PaymentSplitter.sol
Created June 27, 2022 14:30 — forked from Chmarusso/PaymentSplitter.sol
This smart contract will automatically divide the payment amount and push it to specified recipients.
pragma solidity ^0.8.15;
// SPDX-License-Identifier: MIT
contract PaymentSplitter {
address payable [] public recipients;
event TransferReceived(address _from, uint _amount);
constructor(address payable [] memory _addrs) {
for(uint i=0; i<_addrs.length; i++){
recipients.push(_addrs[i]);
@bennotti
bennotti / TimeUtils.cs
Created March 15, 2022 22:47 — forked from AntonyKapustin/TimeUtils.cs
CurrentTimeMillis() in C#
using System;
public class TimeUtils {
private static readonly DateTime Jan1st1970 = new DateTime
(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
public static long CurrentTimeMillis()
{
return (long) (DateTime.UtcNow - Jan1st1970).TotalMilliseconds;
}