Skip to content

Instantly share code, notes, and snippets.

@jafow
jafow / zillow.py
Created May 9, 2022 03:45
getting zillow info about CO
import logging
import re
from pathlib import Path
from bs4 import BeautifulSoup
logging.basicConfig()
logger = logging.getLogger()
def get_address(article) -> str:
@jafow
jafow / d1.rs
Created December 2, 2021 21:39
aoc2021-d1
use common::{input, input_to_vec_ints};
fn p1 (xs: &Vec<i32>) -> u32 {
let mut iter = xs.iter();
let mut counter = 0_u32;
let mut last = iter.next();
for x in iter {
if last < Some(x) {
counter += 1;
@jafow
jafow / report.md
Last active December 16, 2020 07:12
ballotnav loadtest reports

load test results

using quick & dirty loadtest on a few jurisdiction & lat lon

jurisdiction

URL Errors Number requests concurrency Mean response time (ms)
/public/jurisdictions/407 0 5000 20 604
@jafow
jafow / Makefile
Last active February 17, 2021 04:17
passbolt demo
.PHONY: init-once up down
up:
docker-compose up -d
@echo "===============running on http://localhost:8080======================="
down:
docker-compose stop
docker-compose down
@jafow
jafow / readme.md
Last active October 12, 2020 05:21
big beautiful update wip jurisdiction

update wip jurisdiction

this is a sample request payload to update an existing wip jurisidiction all in 1 go.

In this payload for example we are updating an existing location and also adding a new location.

Keybase proof

I hereby claim:

  • I am jafow on github.
  • I am jafow (https://keybase.io/jafow) on keybase.
  • I have a public key ASCO6UXMbPmI3V42NNPArw4qPx-TggkxgtWCNoj_PtaeDwo

To claim this, I am signing this object:

@jafow
jafow / main.tf
Last active November 1, 2019 22:55
terraform acm cert with dns validation cross account
# -- provider for dev profile
provider "aws" {
max_retries = "5"
profile = "dev"
region = "us-west-2"
assume_role {
role_arn = "arn:aws:iam::123456789:role/DevRole"
}
}
@jafow
jafow / main.rs
Created February 17, 2019 16:59
1s complement
fn main() {
// bitwise complement of unsigned int
let bw: u32 = 1;
let nbw = !bw;
assert_eq!(nbw, 4294967294);
// bitwise complement of signed int
let bw: i32 = 1;
@jafow
jafow / vec_enum_example.rs
Created September 13, 2018 06:28
A Vec of Enums containing different types
fn main() {
// make a type Cell that contains a few different primitive types
enum Cell {
Text(String),
Num(i32),
Float(f32)
}
// make a list of them
let row = vec![
@jafow
jafow / awl.md
Last active April 9, 2018 21:07
awl - spec

Overview

awl is a module for connecting peers that are both behind a p2p friendly NAT;

  • a rendezvous server Ṟ -- globally available IP addr -- listens for UDP connections

  • Ṟ connects two peers A → B;

    • If A wants to connect to B, A pings Ṟ and receives a response from Ṟ with B's IP/PORT info (B[IP]:B[PORT])