Skip to content

Instantly share code, notes, and snippets.

View theJohnnyBrown's full-sized avatar

Jonathan Brown theJohnnyBrown

View GitHub Profile

Solana Keypairs

Generate a Solana keypair along with a seed phrase:

➜  tmp solana-keygen new --outfile tmp1.json --no-bip39-passphrase

Generating a new keypair
Wrote new keypair to tmp1.json
====================================================================

pubkey: eC86BRbWX6rmqv5d4AWQ22DLKxbXeaPZ4nZDn6xWqcM

@theJohnnyBrown
theJohnnyBrown / pissed off
Created October 23, 2024 13:08 — forked from staccDOTsol/pissed off
pissed off
import {
AddressLookupTableAccount,
Connection,
Keypair,
PublicKey,
TransactionInstruction,
} from "@solana/web3.js";
import { getMarginfiClient } from "./utils";
import { createJupiterApiClient } from "@jup-ag/api";
import { nativeToUi } from "@mrgnlabs/mrgn-common";
<!DOCTYPE html>
<html lang="en">
<head>
<script crossorigin src="https://unpkg.com/react@17/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@17/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
<meta charset="UTF-8">
<title>BranchRank component</title>
</head>
<script type="text/babel">
(for [parcel ["1-22-44-32-010-0027-0040"
"1-22-44-32-010-0083-0100"
"1-26-44-32-A00-0036-0000"
"1-26-44-32-A00-0047-0100"
"1-35-44-32-A00-0015-0100"
"4-10-43-29-120-2481-0090"
"3-01-43-34-010-0354-0081"
"1-13-44-32-A00-0227-0100"
"3-02-43-34-460-000C-0050"
"1-21-43-34-040-000B-0020"
// Navigate to https://facebook.com/MY_PROFILE/photos_of
// Paste this code, it will download each image and click "next" then download the next one
// The delays are to avoid being blocked by facebook
// If it hits an error you can restart by calling download(300) again (or whatever number)
async function downloadImage(imageSrc) {
const image = await fetch(imageSrc);
const imageBlog = await image.blob();
const imageURL = URL.createObjectURL(imageBlog);

Keybase proof

I hereby claim:

  • I am thejohnnybrown on github.
  • I am jonathan_at_dw (https://keybase.io/jonathan_at_dw) on keybase.
  • I have a public key ASBWxjrYL-Tq8UEs16EqReC9_41acfnUPS7HsJr2rd961wo

To claim this, I am signing this object:

% ./gradlew clojureRepl --stacktrace
Script '/Users/jbrown/projects/PigPen/gradle/convention.gradle': line 24
The ConfigurationContainer.add() method has been deprecated and is scheduled to be removed in Gradle 2.0. Please use the create() method instead.
The TaskContainer.add() method has been deprecated and is scheduled to be removed in Gradle 2.0. Please use the create() method instead.
:pigpen:clojureRepl
Exception in thread "main" java.io.FileNotFoundException: Could not locate clojure/tools/nrepl/server__init.class or clojure/tools/nrepl/server.clj on classpath:
at clojure.lang.RT.load(RT.java:443)
at clojure.lang.RT.load(RT.java:411)
at clojure.core$load$fn__5018.invoke(core.clj:5530)
at clojure.core$load.doInvoke(core.clj:5529)
@theJohnnyBrown
theJohnnyBrown / gist:a5a86eaf95302b011f43
Last active August 29, 2015 14:13
PigPen avro loader
(ns load-avro.core
(:require [clojure.string :as str]
[pigpen.raw :as raw]
[pigpen.core :as pig]
[pigpen.extensions.test :refer [pigsym-zero pigsym-inc]]
[clojure.data.json :refer [read-str]]
[clojure.repl])
(:import [org.apache.avro
Schema
Schema$Type
@theJohnnyBrown
theJohnnyBrown / gist:931d6c9de984a5cc1a81
Created May 1, 2014 00:02
Rainforest QA hoop jumping
import json, requests
url = 'http://letsrevolutionizetesting.com/challenge'
while url:
res = json.loads(requests.get(url, headers={"Accept": 'application/json'}).content)
print res
url = res.get('follow')
@theJohnnyBrown
theJohnnyBrown / explanation.clj
Last active December 20, 2015 22:19
How the anabolic website works
;; so I know you're probably curious what I'm up to that could possibly
;; take as long as it has to get a simple site running with a few pages and a
;; contact form, especially when you have essentially the same site already
;; running on your laptop. I wrote this document to explain why.
;; I will explain these things by showing you some code. I'm going to show the
;; interesting bits and leave out quite a bit. In other words, if you want this
;; stuff to actually work on your computer, clone the anabolic-website
;; repository and "use the source, Luke".