Skip to content

Instantly share code, notes, and snippets.

View jozanza's full-sized avatar
👾
pixels + p2p

Josiah Savary jozanza

👾
pixels + p2p
View GitHub Profile
@jozanza
jozanza / lib.rs
Last active December 14, 2023 07:12
Pancake Cat
// Define the game configuration using the turbo::cfg! macro
turbo::cfg! {r#"
name = "Pancake Cat"
version = "1.0.0"
author = "Turbo"
description = "Catch falling pancakes!"
[settings]
resolution = [256, 144]
"#}
@jozanza
jozanza / borshDecoder.ts
Last active February 9, 2022 12:30
Borsh parsing is really pretty simple
// https://gist.github.com/diafygi/90a3e80ca1c2793220e5/
const B58_CHARS = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
// prettier-ignore
const toBase58: (buf: Uint8Array, map?: string) => string = (B: any, A: any = B58_CHARS) => {let d: any = [], s = '', i: any, j: any, c, n; for(i in B){j=0,c=B[i];s+=c||s.length^i?"":1;while(j in d||c){n=d[j];n=n?n*256+c:c;c=n/58|0;d[j]=n%58;j++}}while(j--)s+=A[d[j]];return s;}
export const toJSON = (data: any) => {
return JSON.stringify(
data,
(_key, value) => (typeof value === 'bigint' ? value.toString() : value),
2,
@jozanza
jozanza / sol_devnet_faucet.md
Last active January 22, 2024 12:48
Use Cloudflare Workers to make a Solana Devnet Faucet.

Solana Devnet Faucet

Here's a quick walkthrough on how to use Cloudflare Workers to make a Solana Devnet Faucet.

Get started by setting up your workspace with a few commands

cargo install wrangler # or npm install -g @cloudflare/wrangler
wrangler generate sol-devnet-faucet https://github.com/cloudflare/rustwasm-worker-template/
cd sol-devnet-faucet
@jozanza
jozanza / main.rs
Last active January 10, 2022 09:06
Mint a Solana NFT
use metaplex_token_metadata::{
instruction::create_metadata_accounts,
state::{Metadata, PREFIX},
};
use solana_client::rpc_client::RpcClient;
use solana_program::{
borsh::try_from_slice_unchecked, program_pack::Pack, system_instruction::create_account,
};
use solana_sdk::{
pubkey::Pubkey,
@jozanza
jozanza / download_all_burnt_mice_svgs.js
Last active September 18, 2021 16:49
⚠️ Remember to npm install ethers in the same directory as this file
const fs = require("fs");
const ethers = require("ethers");
const INFURA_PROJECT_ID = "REPLACE_THIS_WITH_YOUR_PROJECT_ID"
const BURN_ADDRESS = "0x000000000000000000000000000000000000dead";
const anonymice = new ethers.Contract(
"0xbad6186E92002E312078b5a1dAfd5ddf63d3f731",
'[{"inputs":[],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"approved","type":"address"},{"indexed":true,"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"Approval","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"owner","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"from","type":"
@jozanza
jozanza / hello.c
Last active November 11, 2019 22:22
#include <raylib.h>
int main(void) {
char* greeting = "Hello, World!";
int x = 0;
int y = 0;
int fontSize = 72;
InitWindow(800, 600, greeting);
SetTargetFPS(60);
while (!WindowShouldClose()) {
@jozanza
jozanza / greet.c
Last active November 11, 2019 21:48
// This file implements the interface described in its header (greet.h)
#include "greet.h"
#include <stdio.h>
void greet(char* name) {
printf("Hello, %s!\n", name);
}
@jozanza
jozanza / hello.c
Last active November 6, 2019 03:45
#include <stdio.h> // where printf comes from
int main(void) {
printf("Hello, World!\n");
return 0;
}

Gitcoin is a valuable tool for any open source project -- blockchain-related or otherwise. At Livepeer, we started adding Gitcoin bounties to issues shortly after our launch on the Ethereum main network and were thrilled to see an immediate and enthusiastic response from the developer community. Based on our experience interacting with bounty hunters, here's what we think makes a good bounty:

  1. Don't Skimp

If an issue is underpriced, there's not a high incentive for anyone to take it or close it out quickly even if they do accept. Price issues fairly.

  1. Be Clear

Give an overview of the task, critical info needed to complete it, and any potential pitfalls to look out for along the way. Avoid overloading the issue with too many details about implementation. Instead, spend ample time documenting contribution guidelines, project-specific conventions, and FAQs in the README. Developers need far less hand-holding when they can easily find the information they are looking for.

@jozanza
jozanza / notes.md
Last active February 23, 2018 16:39
Community Call 2/22 - Notes

Community Call 2/22 - Notes

General Updates

Yondon

  • Truebit validation in-progress.
  • Why Truebit?
    • The protocol needs to confirm transcoders are doing their work correctly.
    • Truebit is trustless / decentralized.
  • Truebit & Livepeer learning about each other's protocols is really helpful.