Skip to content

Instantly share code, notes, and snippets.

View autodidacticon's full-sized avatar

Richard Moorhead autodidacticon

View GitHub Profile
@autodidacticon
autodidacticon / results
Created September 28, 2023 14:11
scala.collection.parallel.mutable.ParMap vs java.util.concurrent.ConcurrentHashMap
scala> :load test.sc
val args: Array[String] = Array()
Loading test.sc...
import java.lang.System.nanoTime
import java.util.concurrent.ConcurrentHashMap
import scala.collection.mutable
import scala.collection.parallel.mutable.{ParArray, ParHashMap}
import scala.jdk.CollectionConverters.ConcurrentMapHasAsScala
val javaMap: scala.collection.concurrent.Map[Long,Long] = Map()
val scalaMap: scala.collection.parallel.mutable.ParHashMap[Long,Long] = ParHashMap()
@autodidacticon
autodidacticon / alchemy-nft-metadata.json
Created February 15, 2022 19:14
alchemy-getNFTs-with-metadata
{
"ownedNfts": [
{
"contract": {
"address": "0x0beed7099af7514ccedf642cfea435731176fb02"
},
"id": {
"tokenId": "0x000000000000000000000000000000000000000000000000000000000000001c",
"tokenMetadata": {
"tokenType": "ERC721"
@autodidacticon
autodidacticon / cmc-swagger.yml
Last active February 9, 2024 06:51
cmc-swagger
openapi: '3.0.3'
info:
title: CoinMarketCap Cryptocurrency API Documentation
version: 1.26.0
description: "# Introduction\nThe CoinMarketCap API is a suite of high-performance RESTful JSON endpoints that are specifically designed to meet the mission-critical demands of application developers, data scientists, and enterprise business platforms.\n\nThis API reference includes all technical documentation developers need to integrate third-party applications and platforms. Additional answers to common questions can be found in the [CoinMarketCap API FAQ](https://coinmarketcap.com/api/faq).\n\n# Quick Start Guide\n\nFor developers eager to hit the ground running with the CoinMarketCap API here are a few quick steps to make your first call with the API.\n\n1. **Sign up for a free Developer Portal account.** You can sign up at [pro.coinmarketcap.com](https://pro.coinmarketcap.com) - This is our live production environment with the latest market data. Select the free `Basic` plan if it meets your needs or upgra
@autodidacticon
autodidacticon / mac.sh
Last active January 6, 2022 07:22
mac.sh
#!/bin/bash
# macos provisioning script
# prerequisites: hostname folder must exist as host-$HOSTNAME
# usage: mac.sh hostname
HOSTNAME=$1
sudo hostname $HOSTNAME
scutil --set HostName $HOSTNAME
cd ~

Keybase proof

I hereby claim:

  • I am autodidacticon on github.
  • I am richardmoorhead (https://keybase.io/richardmoorhead) on keybase.
  • I have a public key ASAJEZBGPyDeiHsgXnfCPL-9yeSqa_XqTP8XHjorep2L_Ao

To claim this, I am signing this object:

@autodidacticon
autodidacticon / helm.yaml
Created February 5, 2019 04:25
helm-svc-acct
apiVersion: v1
kind: ServiceAccount
metadata:
name: helm
namespace: kube-system
---
apiVersion: rbac.authorization.k8s.io/v1beta1
kind: ClusterRoleBinding
metadata:
name: helm

Keybase proof

I hereby claim:

  • I am autodidacticon on github.
  • I am richardmoorhead (https://keybase.io/richardmoorhead) on keybase.
  • I have a public key ASBJOvopCcKLtMeWPgL-dtOGH98okjFBPv8KIj8Aytj0Dwo

To claim this, I am signing this object:

@autodidacticon
autodidacticon / atlas_setup.sh
Last active March 6, 2018 18:06
atlas_setup.sh
#!/bin/bash
#install Xcode CLT
xcode-select --install
# install Homebrew
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# install 'brew bundle'
brew tap homebrew/bundle
@autodidacticon
autodidacticon / .bashrc
Created January 22, 2017 00:21
EMR pyspark bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
# set the default region for the AWS CLI
export AWS_DEFAULT_REGION=$(curl --retry 5 --silent --connect-timeout 2 http://169.254.169.254/latest/dynamic/instance-identity/document | grep region | awk -F\" '{print $4}')
export JAVA_HOME=/etc/alternatives/jre
# added by Anaconda2 4.2.0 installer
export PATH="/home/hadoop/anaconda2/bin:$PATH"
@autodidacticon
autodidacticon / pg_index_utilization.sql
Created June 3, 2016 15:12
pg_index_utilization.sql
WITH table_scans as (
SELECT relid,
tables.idx_scan + tables.seq_scan as all_scans,
( tables.n_tup_ins + tables.n_tup_upd + tables.n_tup_del ) as writes,
pg_relation_size(relid) as table_size
FROM pg_stat_user_tables as tables
),
all_writes as (
SELECT sum(writes) as total_writes
FROM table_scans