Skip to content

Instantly share code, notes, and snippets.

@rbrick
rbrick / artifacts...build-info...c7b959fcbba31847bedeecf4657e4425.json
Created November 23, 2022 19:08
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.13+commit.abaa5c0e.js&optimize=false&runs=200&gist=
This file has been truncated, but you can view the full file.
{
"id": "c7b959fcbba31847bedeecf4657e4425",
"_format": "hh-sol-build-info-1",
"solcVersion": "0.8.13",
"solcLongVersion": "0.8.13+commit.abaa5c0e",
"input": {
"language": "Solidity",
"sources": {
"ThrowawayNFT_flat.sol": {
"content": "\n// File: @openzeppelin/contracts/utils/Address.sol\n\n\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\n\npragma solidity ^0.8.1;\n\n/**\n * @dev Collection of functions related to the address type\n */\nlibrary Address {\n /**\n * @dev Returns true if `account` is a contract.\n *\n * [IMPORTANT]\n * ====\n * It is unsafe to assume that an address for which this function returns\n * false is an externally-owned account (EOA) and not a contract.\n *\n * Among others, `isContract` will return false for the following\n * types of addresses:\n *\n * - an externally-owned account\n * - a contract in construction\n * - an address where a contract will be created\n * - an address where
@rbrick
rbrick / fabf6ed337c6b03a3609297074230883.json
Last active November 23, 2022 18:57
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.13+commit.abaa5c0e.js&optimize=false&runs=200&gist=
This file has been truncated, but you can view the full file.
{
"id": "fabf6ed337c6b03a3609297074230883",
"_format": "hh-sol-build-info-1",
"solcVersion": "0.8.13",
"solcLongVersion": "0.8.13+commit.abaa5c0e",
"input": {
"language": "Solidity",
"sources": {
"contracts/TelosNFT.sol": {
"content": "pragma solidity ^0.8.13;\n\nimport \"@openzeppelin/contracts/access/Ownable.sol\";\nimport \"@openzeppelin/contracts/security/ReentrancyGuard.sol\";\nimport \"@openzeppelin/contracts/utils/Strings.sol\";\nimport \"./ERC721A.sol\";\n\n\ncontract TelosNFT is ERC721A, Ownable, ReentrancyGuard {\n using Strings for uint256;\n\n enum MintState {\n\n // PUBLIC: open for all, integer id: 0\n PUBLIC,\n // WHITELIST: only used for\n WHITELIST,\n // mint is closed, only admin/owner may mint\n CLOSED\n }\n\n uint256 public immutable MAX_SUPPLY;\n uint256 public immutable MINT_PRICE;\n\n\n uint256 public immutable MAX_MINT_PER_CALL;\n\n\n // the state of whether minting is allowed.\n MintState private minting
@rbrick
rbrick / metamask.html
Last active July 12, 2021 05:32
Messing around with Metamask and Ethereum
<!DOCTYPE html>
<html>
<head>
<script src="/assets/js/web3.min.js"></script>
</head>
<body>
<h1 id="status">Not connected.</h1>
@rbrick
rbrick / msa.go
Last active February 9, 2024 05:02
package main
import (
"bytes"
"context"
"crypto/tls"
"encoding/json"
"fmt"
"golang.org/x/oauth2"
"golang.org/x/oauth2/microsoft"
public static void main(String[] args) throws IOException {
final BufferedImage image = new BufferedImage(1024, 1024, BufferedImage.TYPE_INT_ARGB);
final Graphics graphics = image.getGraphics();
int center = image.getWidth() / 2;
int outerRadius = 512;
int segments = 18;
@Command
public void patch(@Flag("patch") File file, @Flag("server") String server) throws IOException {
if (file.exists()) {
System.out.println("Found server jar...patching...");
JarFile bungeecordJar = new JarFile(file);
byte[] newClassFile = null;
Enumeration<JarEntry> entries = bungeecordJar.entries();
while (entries.hasMoreElements()) {
JarEntry jarEntry = entries.nextElement();
@rbrick
rbrick / fixed.java
Last active February 5, 2024 11:15
ClassReader reader = new ClassReader(bungeecordJar.getInputStream(jarEntry));
ClassWriter classWriter = new ClassWriter(ClassWriter.COMPUTE_FRAMES | ClassWriter.COMPUTE_MAXS);
ClassNode node = new ClassNode(); {
reader.accept(node, 0);
}
for (int i = 0; i < node.fields.size(); i++) {
// prevent duplicates if the jar is already patched
{
"routes": {
"/": "assets/html/index.html",
"/images/compass.png": "assets/images/compass.png",
"/js/site.js": "assets/js/site.js",
"/js/util.js": "assets/js/util.js",
"/js/graph.js": "assets/js/graph.js",
"/css/main.css": "assets/css/main.css"
},
"faviconOverride": {
[
{
"name":"DreamZ",
"ip":"dreamz.io",
"type":"PC",
"category":"soup"
},
{
"name":"SoupsMC",
"ip":"soupsmc.com",
@rbrick
rbrick / encoder.go
Last active November 19, 2018 01:05
a minimal implementation of RESP/Redis client
package main
import (
"bytes"
"errors"
"fmt"
"io"
)
const (