Skip to content

Instantly share code, notes, and snippets.

View valterlobo's full-sized avatar

Valter Lobo valterlobo

View GitHub Profile
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.7;
contract CrudSimples {
struct Pessoa {
string name;
uint8 idade;
uint id;
@APTy
APTy / LICENSE
Created January 18, 2022 16:07
Signing and Verifying Eth Sign Typed Data (eth_signTypedData_v4)
MIT License
Copyright 2022 APTy
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
@Xavier59
Xavier59 / privatekeysolana.js
Created December 28, 2021 14:49
Convert Solana private key from/to base58/uint8array
// exporting from a bs58 private key to an Uint8Array
// == from phantom private key to solana cli id.json key file
// npm install bs58 @solana/web3.js
const web3 = require("@solana/web3.js");
const bs58 = require('bs58');
let secretKey = bs58.decode("[base58 private key here]");
console.log(`[${web3.Keypair.fromSecretKey(secretKey).secretKey}]`);
// exporting back from Uint8Array to bs58 private key
@prologic
prologic / LearnGoIn5mins.md
Last active July 3, 2024 04:05
Learn Go in ~5mins
@FernandoCelmer
FernandoCelmer / WhatsappMessage.py
Last active June 26, 2024 04:46
Script Python para enviar mensagens automatizadas pelo Whatsapp.
import time
import requests
import webbrowser as web
import pyautogui as pg
import pyttsx3
class WhatsappMessage:
def __init__(self,phone_no, message, time_hour, time_min):
@maheshmurthy
maheshmurthy / index.html
Last active June 1, 2023 03:04
index.html with ethers.js
<!DOCTYPE html>
<html>
<head>
<title>Hello World DApp</title>
<link href='https://fonts.googleapis.com/css?family=Open Sans:400,700' rel='stylesheet' type='text/css'>
<link href='https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css' rel='stylesheet' type='text/css'>
</head>
<body class="container">
<h1>A Simple Hello World Voting Application</h1>
<div class="table-responsive">
# https://stackoverflow.com/questions/29102725/go-sql-driver-get-interface-column-values
var myMap = make(map[string]interface{})
rows, err := db.Query("SELECT * FROM myTable")
defer rows.Close()
if err != nil {
log.Fatal(err)
}
colNames, err := rows.Columns()
if err != nil {
package main
import (
"fmt"
"github.com/ethereum/go-ethereum/accounts"
"github.com/ethereum/go-ethereum/common/hexutil"
"github.com/ethereum/go-ethereum/crypto"
)
@jniltinho
jniltinho / sqlserver-linux-backup.py
Last active October 28, 2021 11:35
SQL Server command line Backup Linux
#!/usr/bin/env python
# -*- coding: utf-8 -*-
## SQL Server command line backup Linux
## On OpenSUSE 42.2 64Bits
## Author: Nilton OS -- www.linuxpro.com.br
## http://stackoverflow.com/questions/880487/sql-server-command-line-backup-statement
## https://docs.microsoft.com/en-us/sql/linux/sql-server-linux-migrate-sqlpackage
## Version: 0.2
### BACKUP SCRIPT SQLSERVER CLI
@chranderson
chranderson / nvmCommands.js
Last active July 23, 2024 09:37
Useful NVM commands
// check version
node -v || node --version
// list locally installed versions of node
nvm ls
// list remove available versions of node
nvm ls-remote
// install specific version of node