Skip to content

Instantly share code, notes, and snippets.

View joemccann's full-sized avatar
💭
Thinking

Joe McCann joemccann

💭
Thinking
View GitHub Profile
@joemccann
joemccann / convert.ts
Last active March 27, 2022 20:17
Convert Solana private key to array
import bs58 from 'bs58'
const bytes = bs58.decode('PRIVATE_KEY_HASH')
console.log(Array.from(bytes))
zo-keeper v0.1.0 (/Users/asymmetricholdingsltd./solana/liqudation-bots/01/zo-keeper)
├── anchor-client v0.21.0
│ ├── anchor-lang v0.21.0
│ │ ├── anchor-attribute-access-control v0.21.0 (proc-macro)
│ │ │ ├── anchor-syn v0.21.0
│ │ │ │ ├── anyhow v1.0.55
│ │ │ │ ├── bs58 v0.3.1
│ │ │ │ ├── heck v0.3.3
│ │ │ │ │ └── unicode-segmentation v1.9.0
│ │ │ │ ├── proc-macro2 v1.0.36
@joemccann
joemccann / install-evmos-on-macos.md
Created February 27, 2022 15:34
Quick and Dirty Gist to Install EVMOS on MacOS

Install EVMOS on MacOS

Install Go if you don't have it. Here's a quick guide.

Download the evmos binary:

Note depending on the release/version you'll need to update the version number and path of the tar file in the commands below. The version for this gist is v1.0.0-beta1/evmos_1.0.0-beta1_Darwin_arm64.tar.gz.

cd ~/Downloads/
#!/usr/bin/env zx
//
// Get array of lambda ARNs
//
let lambdas = JSON.parse(
await $`aws lambda list-functions --function-version ALL --output json --query "Functions[?Runtime=='nodejs10.x'].FunctionArn"`
)
//
@joemccann
joemccann / script.js
Created June 16, 2019 15:19
WebGL Smoke
var camera, scene, renderer,
geometry, material, mesh;
init();
animate();
function init() {
stats = new Stats();
stats.setMode(0);
stats.domElement.style.position = 'absolute';
const tiny = require('tiny-json-http')
const schedule = require('node-schedule')
const {
error,
log
} = console
function main() {
#!/bin/bash
# Set variables
# -----------------------------------
GUNBOT_GITHUB_FOLDER_NAME="Gunbot6.0.2"
GUNBOT_GITHUB_FILE_NAME="GUNBOT_v6.0.2_Poloniex_Bittrex_Patch"
# Set functions
# -----------------------------------
## convert HTML POST data or HTTP GET query string to JSON
## get the raw post data from the AWS built-in variable and give it a nicer name
#if ($context.httpMethod == "POST")
#set($rawAPIData = $input.path('$'))
#elseif ($context.httpMethod == "GET")
#set($rawAPIData = $input.params().querystring)
#set($rawAPIData = $rawAPIData.toString())
#set($rawAPIDataLength = $rawAPIData.length() - 1)
#set($rawAPIData = $rawAPIData.substring(1, $rawAPIDataLength))
PLAY [nship] ******************************************************************
GATHERING FACTS ***************************************************************
<127.0.0.1> ESTABLISH CONNECTION FOR USER: joemccann
<127.0.0.1> REMOTE_MODULE setup
<127.0.0.1> EXEC ['ssh', '-C', '-tt', '-vvv', '-o', 'ControlMaster=auto', '-o', 'ControlPersist=60s', '-o', 'ControlPath=/Users/joemccann/.ansible/cp/ansible-ssh-%h-%p-%r', '-o', 'StrictHostKeyChecking=no', '-o', 'Port=22', '-o', 'KbdInteractiveAuthentication=no', '-o', 'PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey', '-o', 'PasswordAuthentication=no', '-o', 'ConnectTimeout=10', '127.0.0.1', "/bin/sh -c 'mkdir -p $HOME/.ansible/tmp/ansible-tmp-1425681970.52-168315940879894 && chmod a+rx $HOME/.ansible/tmp/ansible-tmp-1425681970.52-168315940879894 && echo $HOME/.ansible/tmp/ansible-tmp-1425681970.52-168315940879894'"]
fatal: [joe-mac-air] => SSH encountered an unknown error. The output was:
OpenSSH_6.2p2, OSSLShim 0.9.8r 8 Dec 2011
debug1:
@joemccann
joemccann / offline-static.md
Created January 24, 2014 16:02
Mother Ski Trip Offline Site

Every year at Mother we have an all-agency ski trip.

This year, we want a responsive site that will work on phones while people are on the slopes. The cell phone coverage there is shit so offline is necessary.

We basically need a schedule of events, phone numbers, etc. Nothing serious and nothing super interactive.

However, we are considering a leaderboard of sorts for some activities, but not a dealbreaker if data is eventually consistent.

Nonetheless, background syncing of sorts and adding to home page is a requirement.