Skip to content

Instantly share code, notes, and snippets.

@zackster
zackster / 120.json
Created August 24, 2022 03:54
120 degreers
{
"Supreme Mathematics": {
"0": "Cypher",
"1": "Knowledge",
"2": "Wisdom",
"3": "Understanding",
"4": "Culture",
"5": "Power",
"6": "Equality",
"7": "God",
@zackster
zackster / solpunks.py
Created August 1, 2021 17:21
linear regression to predict solpunk price based on sales data
import json
import pandas as pd
from sklearn import linear_model
from sklearn.model_selection import train_test_split
def list_traits(a):
return list(map(lambda x: " ".join(x.split(' ')[0:-1]), a.split(',')))
# Load list of all punks
@zackster
zackster / avaElectronSetup.js
Created January 31, 2020 16:58
Setting up spectron to work with multiple loading windows
/* eslint-disable no-param-reassign */
const { default: PQueue } = require('p-queue');
const clc = require('cli-color');
const electronPath = require('electron'); // Require Electron from the binaries included in node_modules.
const { Application } = require('spectron');
const path = require('path');
const { execSync } = require('child_process');
async function waitForWindowsChange(browser) {
const handles0 = await browser.windowHandles().then((h) => h.value);
[{"transaction":{"txId":"3bed2fdaf3d3c22e835fbd705845cd60e07a041318aa465001f2b239d47256c7","time":1562700821769,"status":"pending","statusDetail":"","amount":"0.0100000","asset":{"type":"native","code":"","issuer":"","verifiedDomain":"","issuerName":"","desc":"","infoUrl":""},"displayAmount":"","displayCurrency":"","sourceAmountMax":"","sourceAmountActual":"","sourceAsset":{"type":"","code":"","issuer":"","verifiedDomain":"","issuerName":"","desc":"","infoUrl":""},"isAdvanced":false,"summaryAdvanced":"","operations":null,"fromStellar":"GA6CUYDZJUWLIZEQCZMDP6VEXXIKSNJWJFS4WZOGOOOX5D5ILJLLH7O4","toStellar":"GB2WC4AS4HAGL77UGCDN7WNNXGZ5XMWTVV7YYABHWBT2NKNKHEJSE72N","fromUsername":"dxb","toUsername":"croupier","note":"","noteErr":"","unread":false,"publicNote":"","publicNoteType":"","feeChargedDescription":""},"username":"dxb"},{"transaction":{"txId":"2fe1df162bf616dea9ccfee90bb8315c9834c4832bfd77184292285445b23816","time":1562700837635,"status":"pending","statusDetail":"","amount":"0.0100000","asset":{"type":"na
// tsc --lib es2015 index.ts
import "source-map-support/register";
const _ = await import("lodash");
const axios = await import("axios");
const Bot = await import("./node_modules/keybase-bot");
const bot = new Bot("/Users/zackburt");
const bot2 = new Bot("/Users/zackburt");
{"recipient"=>"beemo@subscribers.codefor.cash", "sender"=>"zack+caf_=beemo=subscribers.codefor.cash@codefor.cash", "subject"=>"Fwd: lnsummers (Lauren Summers) is now a member of the Keybase team codeforcash", "from"=>"Zack Burt <zack@zackburt.com>", "X-Mailgun-Incoming"=>"Yes", "X-Envelope-From"=>"<zack+caf_=beemo=subscribers.codefor.cash@codefor.cash>", "Received"=>"by mail-qk1-f169.google.com with SMTP id b18so8218663qkc.9 for <beemo@codefor.cash>; Sun, 26 May 2019 05:14:04 -0700 (PDT)", "X-Google-Dkim-Signature"=>"v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:delivered-to:dkim-signature:mime-version :references:in-reply-to:from:date:message-id:subject:to; bh=TJ+BtdEfeTf9XddeNa7mxZDYZ+EGcGjPxMsROqGvRP0=; b=HoQus646WTg55Ifnira3MM73kINqwscdIth0/Pi2xuC8m3d9+uit4TE4Z5N6COOMry sF7u0bjwAPuCqtRFt9bE2QmoEv9/GHYnPJVYsjG5EM3J9B9XKzIEcRNkU0eJdbXumVXs K+8bBt2ecZNzNNJas+JIc0TMyEibCmz/PU3aj3lHmpxkK6PJkpw42hJeuZ1xwPsXQeP4
14:11:47 zackburt@Zacks-MBP:~/keybase/client (master)$ go build ./go/keybase
go/keybase/main.go:27:2: cannot find package "github.com/keybase/go-framed-msgpack-rpc/rpc" in any of:
/usr/local/go/src/github.com/keybase/go-framed-msgpack-rpc/rpc (from $GOROOT)
/Users/zackburt/gopath/src/github.com/keybase/go-framed-msgpack-rpc/rpc (from $GOPATH)
go/keybase/main.go:28:2: cannot find package "golang.org/x/net/context" in any of:
/usr/local/go/src/golang.org/x/net/context (from $GOROOT)
/Users/zackburt/gopath/src/golang.org/x/net/context (from $GOPATH)
14:11:47 zackburt@Zacks-MBP:~/keybase/client (master)$ go build ./go/keybase
go/keybase/main.go:27:2: cannot find package "github.com/keybase/go-framed-msgpack-rpc/rpc" in any of:
/usr/local/go/src/github.com/keybase/go-framed-msgpack-rpc/rpc (from $GOROOT)
/Users/zackburt/gopath/src/github.com/keybase/go-framed-msgpack-rpc/rpc (from $GOPATH)
go/keybase/main.go:28:2: cannot find package "golang.org/x/net/context" in any of:
/usr/local/go/src/golang.org/x/net/context (from $GOROOT)
/Users/zackburt/gopath/src/golang.org/x/net/context (from $GOPATH)

Keybase proof

I hereby claim:

  • I am zackster on github.
  • I am zackburt (https://keybase.io/zackburt) on keybase.
  • I have a public key ASA_m_JVvU8LBZn7xJ2lNdQI8JdyKMNJw-CxCFOB1616owo

To claim this, I am signing this object:

@zackster
zackster / max-heap.rb
Last active February 14, 2019 21:49
Implementation of max-heap in Ruby
# O(n)
def heapify(arr)
last_element_index = arr.count - 1
idx = parent_index(last_element_index)
while idx >= 0
arr = fix(arr, idx)
idx -= 1
end
arr
end