Skip to content

Instantly share code, notes, and snippets.

View dacut's full-sized avatar

David Cuthbert dacut

View GitHub Profile
@dacut
dacut / chat-systems.txt
Created June 27, 2023 17:15
Chat systems
Discord
Midjourney
Rust
Gitter
Diesel
Pest
Matrix
Esp-rs
Slack
Last Week in AWS
const PRIMES: [u32; 23000] = include!("primes.txt");
macro_rules! sum {
($n:expr) => {
$n
};
($n:expr, $($rest:expr),+) => {
$n + sum!($($rest),+)
};
}
@dacut
dacut / main.rs
Created September 30, 2022 18:37
Rust HRTB bug
use {
std::{
future::Future,
pin::Pin,
task::{Context, Poll},
},
tower::{BoxError, Service, ServiceExt},
};
pub struct WrapperService<Pre, Handler, ErrorHandler>
@dacut
dacut / compare_policies.py
Last active April 22, 2022 23:35
IAM policy to get under the IAM policy size restrictions
#!/usr/bin/env python3
from fnmatch import fnmatch
import json
from os import environ
gopath = environ["GOPATH"]
with open(f"{gopath}/src/github.com/aws/aws-sdk-go-v2/codegen/sdk-codegen/aws-models/backup.json", "r") as fd:
backup_model = json.load(fd)
@dacut
dacut / hypertraits.md
Created March 22, 2021 04:27
Hyper traits

Hyper wants services to implement the HttpService trait, and service makers to implement the MakeServiceRef trait. These aren't exposed outside of Hyper, however.

If we could use the HttpService trait, this is what it looks like to wrap another service:

struct WrappingService<S> {
    wrapped: S,
}

impl HttpService for WrappingService
@dacut
dacut / postgres-12-amzn.spec
Created March 19, 2021 20:55
PostgreSQL 12 SPEC file for Amazon Linux 12
# These are macros to be used with find_lang and other stuff
%global packageversion 120
%global pgmajorversion 12
%global pgpackageversion 12
%global prevmajorversion 11
%global sname postgresql
%global pgbaseinstdir /usr/pgsql-%{pgmajorversion}
%global beta 0
%{?beta:%global __os_install_post /usr/lib/rpm/brp-compress}
@dacut
dacut / terraform.log
Created February 17, 2021 20:11
terraform providers lock issue
2021/02/17 12:11:07 [INFO] Terraform version: 0.14.6
2021/02/17 12:11:07 [INFO] Go runtime version: go1.15.7
2021/02/17 12:11:07 [INFO] CLI args: []string{"/usr/local/bin/terraform", "providers", "lock", "-platform=linux_amd64", "-platform=windows_amd64", "-platform=darwin_amd64", "-platform=linux_arm64"}
2021/02/17 12:11:07 [DEBUG] Attempting to open CLI config file: /Users/dacut/.terraformrc
2021/02/17 12:11:07 Loading CLI configuration from /Users/dacut/.terraformrc
2021/02/17 12:11:07 Loading CLI configuration from /Users/dacut/.terraform.d/credentials.tfrc.json
2021/02/17 12:11:07 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2021/02/17 12:11:07 [DEBUG] ignoring non-existing provider search directory /Users/dacut/.terraform.d/plugins
2021/02/17 12:11:07 [DEBUG] ignoring non-existing provider search directory /Users/dacut/Library/Application Support/io.terraform/plugins
2021/02/17 12:11:07 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io
@dacut
dacut / discussion.md
Created September 14, 2020 18:07
NWS Seattle Forecast Discussion 2020-09-14 0300

Area Forecast Discussion

Issued by NWS Seattle/Tacoma, WA

000
FXUS66 KSEW 141018
AFDSEW

Area Forecast Discussion
National Weather Service Seattle WA
@dacut
dacut / discussion.md
Created September 14, 2020 18:02
NWS Seattle Forecast Discussion

Area Forecast Discussion

Issued by NWS Seattle/Tacoma, WA

000
FXUS66 KSEW 140310
AFDSEW

Area Forecast Discussion  
National Weather Service Seattle WA 
@dacut
dacut / LazySimpleSerDe.md
Last active August 17, 2020 21:35
Apache Hive SerDe properties

org.apache.hadoop.hive.serde2.lazy.LazySimpleSerDe

Constant Expanded Default Description
COLUMN_NAME_DELIMITER column.name.delimiter ,
FIELD_DELIM field.delim
COLLECTION_DELIM collection.delim
MAPKEY_DELIM mapkey.delim
SERIALIZATION_FORMAT serialization.format
SERIALIZATION_NULL_FORMAT serialization.null.format