Skip to content

Instantly share code, notes, and snippets.

View akotlar's full-sized avatar

Alex V. Kotlar akotlar

  • Boston, MA
View GitHub Profile
@akotlar
akotlar / ec2-amazon-ami-setup-raid0
Last active August 9, 2016 22:23
Seqant ec2 setup script; sets up raid0
#! /usr/bin/env bash
sudo yum update -y
sudo yum install git -y
sudo gem install rmate
sudo yum install sysstat -y
touch ~/.inputrc
(echo ""; echo '"\e[A": history-search-backward') >> ~/.inputrc
(echo ""; echo '"\e[B": history-search-forward') >> ~/.inputrc
@akotlar
akotlar / insertion-sort.go
Created April 2, 2017 21:12
Insertion sort in Golang
package main
import (
"fmt"
"log"
"os"
"strconv"
"strings"
)
@akotlar
akotlar / PType-proposal-Q1-2020.md
Last active December 14, 2019 19:16
PType proposal

What are Physical Types?

Physical types are the classes that create in-memory representations (or code generate the in-memory representations), of Hail Types (Virtual Types). They serve as the implementations of Virtual Types, which are interfaces

Where possible Physical Type behavior should follow Python type behavior.

This proposal deals with the architectural goals of the PType implementation for 2020 Q1.

Motivation:

@akotlar
akotlar / gist:cab79d5a355c8c99dc9e4376b530c80d
Created July 5, 2023 19:53
Log free memory every 2 seconds
while true; do echo -e "\n$(date '+%a %H:%M:%S.%3N')\t$(free -h | awk 'NR==2 {print "Total:", $2, "Used:", $3, "Free:", $4, "Shared:", $5, "Buff/Cache:", $6, "Available:", $7}')" >> /path/to/log; sleep 2; done
from msgspec import json, Struct, Meta
from typing import Annotated
from msgspec import Struct, Meta
import re
_VCF_REGEX = ".*\.vcf(\.(gz|lz4|zstd|bzip2))?$"
class AncestrySubmission(Struct):
vcf_path: Annotated[str, Meta(pattern=_VCF_REGEX)]