Skip to content

Instantly share code, notes, and snippets.

View melanke's full-sized avatar
The future is already here, it's just not evenly distributed

Gil Lopes Bueno melanke

The future is already here, it's just not evenly distributed
View GitHub Profile
@melanke
melanke / GetParsedNotificationAfterWrittingOnEthereum.tsx
Created November 14, 2024 19:39
Ethereum: How to get a parsed event after writting on a contract (Using Scaffold-eth and Viem)
import React from "react";
import { Abi, parseEventLogs } from "viem";
import { useDeployedContractInfo, useScaffoldWriteContract } from "~~/hooks/scaffold-eth";
export const MyComponent: React.FC = () => {
const { data: contractInfo } = useDeployedContractInfo("MyContract");
const { writeContractAsync } = useScaffoldWriteContract("MyContract");
const handleSubmit = async (e: React.FormEvent) => {
e.preventDefault();
@melanke
melanke / Git-help.md
Created May 26, 2022 14:01
Configurar Git / Github / SSH / IntelliJ / start-ssh-agent / Putty / Peagent / Sourcetree

Configurar Git / Github / SSH / IntelliJ / start-ssh-agent / Putty / Peagent / Sourcetree

Quando você clona um projeto git pode escolher entre trabalhar com HTTPS ou SSH. Trabalhar com HTTPS é mais prático mas nem sempre é possível, existem alguns mecanismos de segurança que não vão funcionar. Então esse setup é necessário para superar qualquer barreira de permissão:

  • Crie uma nova chave: ssh-keygen -t rsa -C "<seu e-mail logado no github>"
  • Copie o conteúdo do arquivo ~/.ssh/id_rsa.pub
    • Existe uma pasta oculta chamada .ssh dentro da pasta do seu user do windows (C:/Users/seunome/.ssh), é nessa pasta que está este arquivo.
  • Entre nesse link, cadastre uma nova chave e cole oq vc copiou
  • Rode esse código pra testar se funcionou: ssh -T [email protected]
  • Deve mostrar algo como: Hi developius! You've successfully authenticated, but GitHub does not provide shell access.
@melanke
melanke / CoZ-Gil-Contribution-Week65.md
Created October 1, 2018 13:23
CoZ-Gil-Contribution-Week65.md
@melanke
melanke / CoZ-Gil-Contribution-Week64.md
Created September 24, 2018 14:04
CoZ-Gil-Contribution-Week64.md
@melanke
melanke / Gil-Contribution-Week-61.md
Last active September 3, 2018 16:59
Gil Contribution Week 61

Neo-Sharp

Fix #308 - Implement "IsDoubleSpend" method (And GetUnspent method)

Neo Black Sea

Workshop preparation with @ricklock

  • Creation of examples / templates using C#
  • Neo eco-system review (for the presentation)
@melanke
melanke / Gil-Contribution-Week-56.md
Created July 30, 2018 15:40
Gil Contribution Week 56
@melanke
melanke / gil-contribution-week-54.md
Created July 24, 2018 14:56
Gil Contribution Week 55
@melanke
melanke / gil-contribution-week-54.md
Created July 17, 2018 06:42
Gil Contribution Week 54

"I was inspired by:"

All libraries that give me the ideas to build this.


This is an idea to make the Github community more thankful by who inspired itself.

  • create a I_WAS_INSPIRED_BY.md to talk about it
@melanke
melanke / statisticalOutLierAnalysis.java
Created December 15, 2016 20:15
statisticalOutLierAnalysis.java discover numbers outside standard deviation
public static List<Double> statisticalOutLierAnalysis(List<Double> allNumbers) {
if (allNumbers.isEmpty()) {
return null;
}
List<Double> normalNumbers = new ArrayList<Double>();
List<Double> outLierNumbers = new ArrayList<Double>();
Double sum = 0D;
for (Double number : allNumbers) {