Skip to content

Instantly share code, notes, and snippets.

View blurpesec's full-sized avatar

michael - blurpesec blurpesec

View GitHub Profile
@blurpesec
blurpesec / outbound-email-with-cloudflare.md
Created September 4, 2023 20:24 — forked from irazasyed/outbound-email-with-cloudflare.md
Using Gmail SMTP with Cloudflare Email Routing: A Step-by-Step Guide

Using Gmail SMTP with Cloudflare Email Routing: Step-by-Step Guide

Learn how to send emails through Gmail SMTP with Cloudflare Email Routing in this comprehensive guide.

Step 1: Enable 2-Factor Authentication

To proceed with this method, ensure that you have enabled two-factor authentication for your Google account. If you haven't done so already, you can follow the link to set it up → Enable 2FA in your Google account.

Step 2: Create an App Password for Mail

@blurpesec
blurpesec / delegatable_eoa_eoa.ts
Created May 9, 2023 21:20
Delegation - EOA -> EOA
expect(await Delegatable.purpose()).to.eq("What is my purpose?");
const delegation = {
delegate: wallet1.address,
authority:
"0x0000000000000000000000000000000000000000000000000000000000000000",
caveats: [],
salt: 0,
};
const delegationSignature = signingUtil.signTypedDataLocal(
@blurpesec
blurpesec / delegatable.ts
Created May 9, 2023 21:19
Delegation - to smart contract.
const recipient = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045"
const initialBalance = await hre.ethers.provider.getBalance(recipient)
await signer0.sendTransaction({
to: SmartAccount.address,
value: ethers.utils.parseEther("1"),
})
// Create Delegation
const delegation = {
@blurpesec
blurpesec / ExistingTransactionTypes.go
Last active October 20, 2022 10:17
Transaction data types
// etherscan's normal tx
type NormalTx struct {
BlockNumber int `json:"blockNumber,string"`
TimeStamp Time `json:"timeStamp"`
Hash string `json:"hash"`
Nonce int `json:"nonce,string"`
BlockHash string `json:"blockHash"`
TransactionIndex int `json:"transactionIndex,string"`
From string `json:"from"`
To string `json:"to"`
@blurpesec
blurpesec / getAssetIconUrl.js
Created May 7, 2020 20:22
getAssetIconurl Example
import getUuid from 'uuid-by-string';
import { toChecksumAddress } from 'ethereumjs-util';
const chainId = '1' // chainId of network asset relies on (1 = ethereum)
const daiContractAddress = '0x6B175474E89094C44Da98b954EedeAC495271d0F' // Contract address of token
// This is used to generate a deterministic network-unique asset uuid.
const generateUUIDByIdAndAddress = (chainId, address) =>
address
? getUuid(`${chainId}-${toChecksumAddress(address)}`)
@blurpesec
blurpesec / All_Assets_Object_v1.js
Last active April 5, 2020 19:12
Asset object schema for use in MyCrypto :-D
module.exports = {
"e1f698bf-cb85-5405-b563-14774af14bf1": {
uuid: "e1f698bf-cb85-5405-b563-14774af14bf1", // required - generated deterministically based on network chainId && contract address.
ticker: "DAI", // required - comes from ethereum-lists
name: "Dai Stablecoin v2.0", // required - comes from ethereum-lists
networkId: "Ethereum", // required - comes from ethereum-lists
type: "erc20", // required - Must be either 'erc20' or 'base'
decimal: 18, // required - comes from ethereum-lists
contractAddress: "0x6B175474E89094C44Da98b954EedeAC495271d0F", // only display when type = 'erc20' - comes from ethereum-lists
mappings: { // Comes from the mycryptohq/assets repo.
@blurpesec
blurpesec / reserveMap.json
Last active June 29, 2021 21:52
Ex DeFiReserveMap.json
{
"0039e50a-bab5-52fc-a48f-43f36410a87a": {
"type": "uniswap",
"lastUpdated": 1584322184,
"reserveRates": [
{
"assetId": "356a192b-7913-504c-9457-4d18c28d46e6",
"rate": "1.7700147975060911"
},
{
@blurpesec
blurpesec / gist:5c5773bbb6832ba7c564ecd5564430dc
Last active February 10, 2020 19:53
Example panel styling
const Panel = styled('section')`
padding: 20px;
background-color: white;
`
const GrayPanel = styled(Panel)`
background-color: gray;
`
html:
// basically after you get the mapped array, you can just create a new object like this:
const arrayOfObjects = [
{
'name': 'one',
'foo': 1,
'foobar': 2,
'foobarbaz': 3
},
{
'name': 'two',
@blurpesec
blurpesec / keybase.md
Created September 11, 2019 19:53
keybase.md

Keybase proof

I hereby claim:

  • I am blurpesec on github.
  • I am michaelhahn (https://keybase.io/michaelhahn) on keybase.
  • I have a public key ASDt2i9_Q8DKksy__yJUUbHTLddfS4Gill_uI5TkN9OSFQo

To claim this, I am signing this object: