Skip to content

Instantly share code, notes, and snippets.

@Austinhs
Austinhs / anvil.js
Created February 20, 2025 14:13
Simple Anvil Wrapper
import { ethers } from "ethers";
import { getChain } from "./helpers.js";
import { spawn } from "child_process";
import { openSync, existsSync, mkdirSync } from "fs";
import net from 'net';
export default class Anvil {
forkRpc;
forkProvider;
blockNumber;
@Austinhs
Austinhs / main.go
Created October 31, 2023 14:12
wait groups & go routines
package main
import (
"crate-mix/lib/mix"
"crate-mix/lib/settings"
"fmt"
"log"
"os"
"sync"
)
@Austinhs
Austinhs / getCreditCardType.js
Created May 22, 2023 15:35
getCreditCardType
function getCreditCardType(cc) {
let amex = new RegExp('^3[47][0-9]{0,13}$');
let visa = new RegExp('^4[0-9]{0,12}(?:[0-9]{3})?$');
let mastercard = new RegExp('^5[1-5][0-9]{0,14}$');
let mastercard2 = new RegExp('^2[2-7][0-9]{0,14}$');
let disco1 = new RegExp('^6011[0-9]{0,12}[0-9]*$');
let disco2 = new RegExp('^62[24568][0-9]{0,13}[0-9]*$');
let disco3 = new RegExp('^6[45][0-9]{0,14}[0-9]*$');
if (visa.test(cc)) {
return 'VISA';
package observer
import (
"context"
"da/go-server/src/models"
"da/go-server/src/utils/constants"
"da/go-server/src/utils/database"
"database/sql"
"errors"
"log"
@Austinhs
Austinhs / t.js
Created December 2, 2022 22:43
change network
// Check for the correct chain
const { chainId } = await provider.getNetwork();
if (!(chainId === web3Config.chainId)) {
try {
const chainHex = `${web3Config.chainId}`.toString('hex');
await window.ethereum.request({
method: 'wallet_switchEthereumChain',
params: [{ chainId: `0x${chainHex}` }]
});
} catch (err) {
import socket, ssl, threading, time
target = "pmq.deno.dev"
port = 443
attack_amount = 100000
thread_count = 500
start = time.time()
attack_completed = 0
def attack():
import socket
import threading
import ipaddress
import random
port = 80
attack_amount = 4000000
thread_count = 500
target = "123.45.68.99"
package main
type Example struct {
Name *string
}
func main() {
myStruct := &Example{}
myStruct.Name = "Test"
package main_test
import (
"da/go-server/src/cron/jobs"
"da/go-server/src/models"
"da/go-server/src/utils/database"
"da/go-server/src/utils/eth/observer"
"math"
"testing"
@Austinhs
Austinhs / contract-example.sol
Last active November 17, 2022 23:44
example
modifier canChangeUri(uint256[] memory tokens, string calldata ipfs_uri, bytes calldata signature) {
require(_signer == keccak256(abi.encodePacked(
msg.sender,
tokens,
ipfs_uri
)).toEthSignedMessageHash().recover(signature), "Not approved URI");
_;
}