Skip to content

Instantly share code, notes, and snippets.

View AlbericoD's full-sized avatar
🏠
Working from home

Albérico Dias Barreto Filho AlbericoD

🏠
Working from home
View GitHub Profile
@AlbericoD
AlbericoD / analytics.d.ts
Created June 22, 2023 16:17
Google analytics Overwolf
interface LocalSession {
sessionId?: string;
timestamp?: number;
}
interface PageViewParams {
hit: "page_view";
params: {
page_location: string;
page_title: string;
@AlbericoD
AlbericoD / .deps...npm...@openzeppelin...contracts@4.2.0...access...Ownable.sol
Created July 20, 2021 20:26
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.4+commit.c7e474f2.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "../utils/Context.sol";
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
(0, [7.923583984375], 24.054566752526142),
(1, [7.830810546875], 24.73372832933107),
(2, [7.833251953125], 24.75553454896932),
(3, [7.852783203125], 24.85252324500952),
(4, [7.852783203125], 24.85252324500952),
(5, [7.860107421875], 24.853315818498054),
(6, [7.860107421875], 24.853315818498054),
(7, [7.860107421875], 24.853315818498054),
(8, [7.860107421875], 24.853315818498054),
(9, [7.860107421875], 24.853315818498054),
from gaft import GAEngine
from gaft.components import BinaryIndividual, Population
from gaft.operators import RouletteWheelSelection, UniformCrossover, FlipBitMutation
from gaft.plugin_interfaces.analysis import OnTheFlyAnalysis
from gaft.analysis.fitness_store import FitnessStore
from math import cos, sin
import matplotlib.pyplot as plt
import numpy as np
# Parametros para geração dos individuos
import React, { PureComponent } from "react";
import {
ResponsiveContainer,
ComposedChart,
Line,
Area,
Bar,
XAxis,
YAxis,
CartesianGrid,
// Cria um cliente tmi com nossas opções
const client = new tmi.client(opts);
//intercepta mensagem do chat
function mensagemChegou(alvo, contexto, mensagem, ehBot) {
if (ehBot) {
return; //se for mensagens do nosso bot ele não faz nada
}
const nomeDoComando = mensagem.trim();// remove espaço em branco da mensagem para verificar o comando
// Cria um cliente tmi com nossas opções
const client = new tmi.client(opts);
// Registra nossas funções
client.on('message', mensagemChegou);
client.on('connected', entrouNoChatDaTwitch);
// Connecta na Twitch:
client.connect();
//intercepta mensagem do chat
function mensagemChegou(alvo, contexto, mensagem, ehBot) {
if (ehBot) {
return; //se for mensagens do nosso bot ele não faz nada
}
const nomeDoComando = mensagem.trim();// remove espaço em branco da mensagem para verificar o comando
// checando o nosso comando
if (nomeDoComando === '!comandoUM') {
console.log(`* Foi Executado o comando ${nomeDoComando}`);
const opts = {
identity: {
username: NOME_DO_BOT,
password: O_TOKEN_DO_PASSO_4
},
channels: [ NOME_DO_CANAL_QUE_O_BOT_VAI_FICAR ]
};
@AlbericoD
AlbericoD / coracao-do-bot.js
Last active October 5, 2019 15:58
passo 1
console.log("FERRAMENTAS ESTÃO OK");
const tmi = require('tmi.js');
const NOME_DO_BOT = 'NOME DA SUA CONTA DE BOT'
const NOME_DO_CANAL_QUE_O_BOT_VAI_FICAR = 'NOME DO CANAL'
const O_TOKEN_DO_PASSO_4 = 'TOKEN'