Skip to content

Instantly share code, notes, and snippets.

View ngundotra's full-sized avatar
🍀

Noah Gundotra ngundotra

🍀
View GitHub Profile
@ngundotra
ngundotra / tensor.ts
Last active November 20, 2023 19:35
tensorBuySell.ts
import { AnchorProvider, Wallet } from "@project-serum/anchor";
import {
Connection,
Keypair,
MessageV0,
PublicKey,
TransactionInstruction,
VersionedMessage,
VersionedTransaction,
AccountMeta,
@ngundotra
ngundotra / spl-gov-idl.json
Created August 18, 2022 21:29
Mostly functional SPL Gov Anchor IDL
{
"version": "0.1.0",
"name": "governance",
"instructions": [
{
"name": "createRealm",
"accounts": [
{
"name": "governanceRealmAccount",
"isMut": true,
import { Metaplex, keypairIdentity, bundlrStorage } from '@metaplex-foundation/js';
import { Connection, Keypair, clusterApiUrl } from '@solana/web3.js';
import { readFileSync } from 'fs';
async function sleep(delay: number) {
return new Promise((resolve) => {
setTimeout(() => resolve(null), delay);
});
}
{
"tasks": [
{
"httpTask": {
"url": "https://api.github.com/repos/<org>/<repo>/pulls",
"method": "GET",
"headers": [
{
"key": "User-Agent",
"value": "curl/7.78.0"
@ngundotra
ngundotra / complex_trippy_gif.py
Created May 27, 2018 07:10
Generate cool gifs of complex plots in python
import matplotlib.pyplot as plt
from matplotlib.animation import FuncAnimation
import numpy as np
x = np.linspace(0, 2*np.pi, num=10000)
def f(x):
return np.exp(3*1j*x) + 0.5*np.exp(20j*x) + 1j/7*np.exp(-48j*x) + 0.3j*np.exp(37j*x)
y = f(x)
plt.plot(y.real, y.imag)
fig, ax = plt.subplots(1,1)