Skip to content

Instantly share code, notes, and snippets.

View yourbuddyconner's full-sized avatar

Conner Swann yourbuddyconner

View GitHub Profile
// Define a function to handle the document and return its type
function discoverDocumentType(document) {
// Code to discover the type of document
return documentType;
}
// Define a function to retrieve pre-built question examples from a database
function getQuestionExamples(documentType) {
if (documentType === "legal contract") {
return [
@yourbuddyconner
yourbuddyconner / server.py
Created June 29, 2014 08:53
Python server to listen to a TCP socket and dump traffic to a file, then serve that file via HTTP
# A simple script that creates two TCP sockets, one that listens
# for and handles HTTP traffic on port 9000 and one that
# listens for and handles vanilla TCP traffic on port 9001
# Web Server portion is set up to support Cross Origin Requests, FYI
import sys # for exit()
import BaseHTTPServer # for WebHandler
import SocketServer # for everything
import json # for json parsing
@yourbuddyconner
yourbuddyconner / bootstrap_balances.json
Created February 22, 2021 20:24
Rosetta conf file for mina-rosetta
[]
import docker
import os
import subprocess
import click
import glob
import json
import random
import re
import sys
from pathlib import Path
#!/usr/bin/env python3
# script to find common best-tip prefix over a list of nodes using GraphQL query
import os
import sys
import json
import click
import subprocess
import requests
apiVersion: apps/v1
kind: Deployment
metadata:
name: graphql-proxy-deployment
namespace: coda-testnet
labels:
app: graphql-proxy
spec:
replicas: 1
selector:

Related Reading

Generate a private key:

It's important to note here that without the -v argument, your generated key would be stuck inside the container and deleted when the container exits! This example mounts the current directory pwd inside the container at the /keys path.

docker run --entrypoint /bin/bash -it -v $(pwd)/:/keys codaprotocol/coda-daemon:0.0.11-beta1-release-0.0.12-beta-493b4c6 -c "CODA_PRIVKEY_PASS='password' coda client-old generate-keypair -privkey-path /keys/my_key"

@yourbuddyconner
yourbuddyconner / snark-worker-one.yaml
Created December 27, 2019 01:07
An example deployment of a Coda SNARK Worker. Works out of the box on GKE.
apiVersion: apps/v1
kind: Deployment
metadata:
name: snark-worker-one
namespace: coda-testnet
labels:
app: snark-worker-one
spec:
replicas: 1
selector:
apiVersion: apps/v1
kind: Deployment
metadata:
name: seed-one
namespace: default
labels:
app: seed
spec:
replicas: 1
selector: