Skip to content

Instantly share code, notes, and snippets.

View stevedylandev's full-sized avatar
👾
Hacking

Steve Simkins stevedylandev

👾
Hacking
View GitHub Profile
@stevedylandev
stevedylandev / config.fish
Created April 23, 2024 03:20
A small fish script to feed Oatmeal sessions into fzf and open them
function oatsesh
set selected_session (oatmeal sessions list | awk '{print substr($0, index($0, "latest, ") + 8)}' | fzf)
if test -n "$selected_session"
set full_line (oatmeal sessions list | grep "$selected_session")
set id_value (echo $full_line | grep -o '[a-f0-9]\{8\}-[a-f0-9]\{4\}' | head -n 1)
if test -n "$id_value"
oatmeal sessions open -i $id_value
end
@stevedylandev
stevedylandev / cid.js
Created April 10, 2024 17:36
Predetermine a CID before uploading to Pinata
import { CID } from 'multiformats/cid'
import * as raw from 'multiformats/codecs/raw'
import { sha256 } from 'multiformats/hashes/sha2'
const JWT = "YOUR_PINATA_JWT"
async function main(){
try {
const text = "Hello World!";
const blob = new Blob([text], { type: "text/plain" });
const unit8array = new Uint8Array(await blob.arrayBuffer());
@stevedylandev
stevedylandev / followFid.ts
Created March 27, 2024 04:20
Comparison Between Link Follow and Link Unfollow
import {
Message,
NobleEd25519Signer,
FarcasterNetwork,
LinkBody,
makeLinkAdd
} from "@farcaster/core";
import { hexToBytes } from "@noble/hashes/utils";
const FID = process.env.FID ? parseInt(process.env.FID) : 0;
@stevedylandev
stevedylandev / hub.js
Created February 10, 2024 11:59
Hub GRPC Test
const { getSSLHubRpcClient, Message } = require("@farcaster/hub-nodejs");
async function doStuff() {
try {
const HUB_URL = "hub-grpc.pinata.cloud"
const client = getSSLHubRpcClient(HUB_URL);
const messageBytes = "0a5e080d10d72518ede2b52e200182014f0a3068747470733a2f2f70696e61746164726f70732e636f6d2f6170692f7369676e61747572652d76616c69646174696f6e10011a1908d725121400000000000000000000000000000000000000011214a4d95afb8cf3761b8dff60375c398f8a1407ea7418012240bc9d823ea9b025a7750bc60461ecb8d6ef656d89f3ed24564d7d86e4ad18974d8b9ccb14a3bd6886cbb7249aeecfed5edd156e35cb34123b8a6da3da6c93ed0228013220975eb342c8b39f185e569eab3cf509fbac0c8f6b51e487b1bba30af339dbb79b"
const message = Message.decode(Buffer.from(messageBytes, 'hex'));
const result = await client.validateMessage(message);
console.log(result);
} catch (err) {
@stevedylandev
stevedylandev / verify.js
Created February 6, 2024 15:16
Verify Message
import { getSSLHubRpcClient, Message } from "@farcaster/hub-nodejs";
const HUB_URL = "hub-grpc.pinata.cloud";
const client = getSSLHubRpcClient(HUB_URL);
const frameMessage = Message.decode(Buffer.from(req.body?.trustedData?.messageBytes || '', 'hex'));
const result = await client.validateMessage(frameMessage);
if (result.isOk() && result.value.valid)
@stevedylandev
stevedylandev / speedPin.js
Created January 8, 2024 23:28
Pinning as fast as possible
async function uploadJsonToPinata(jsonData, pinataApiKey) {
const axios = require("axios");
const FormData = require("form-data");
const url = "https://api.pinata.cloud/pinning/pinJSONToIPFS";
try {
const data = JSON.stringify(jsonData);
const response = await axios.post(url, data, {
__zoxide_zi () {
\builtin local result
result="$(\command zoxide query --interactive -- "$@")" && __zoxide_cd "${result}"
}
@stevedylandev
stevedylandev / keys.txt
Created August 28, 2023 02:44
BeepBerry Keydump
keycode range supported by kernel: 1 - 255
max number of actions bindable to a key: 256
number of keymaps in actual use: 7
of which 0 dynamically allocated
ranges of action codes supported by kernel:
number of function keys supported by kernel: 256
max nr of compose definitions: 256
nr of compose definitions in actual use: 68
Symbols recognized by dumpkeys:
(numeric value, symbol)
@stevedylandev
stevedylandev / index.js
Last active June 8, 2024 08:27
Mint an NFT Using Pinata and Crossmint
// Run `npm install form-data node-fetch fs dotenv`
//
// Create a separate .env file with the following variables completed
// PINATA_JWT=
// CROSSMINT_PROJECT_ID=
// CROSSMING_CLIENT_SECRET=
//
// Read more on how this works at
@stevedylandev
stevedylandev / settings.json
Created July 4, 2023 14:08
VSCodeVim Config
{
"editor.accessibilitySupport": "off",
"terminal.integrated.fontFamily": "BerkeleyMono Nerd Font",
"workbench.colorTheme": "Gruvbox Material Dark",
"editor.fontFamily": "BerkeleyMono Nerd Font, Menlo, Monaco, 'Courier New', monospace",
"gruvboxMaterial.darkContrast": "hard",
"editor.inlineSuggest.enabled": true,
"editor.fontSize": 13,
"terminal.external.osxExec": "Alacritty.app",
"terminal.integrated.fontSize": 13,