Skip to content

Instantly share code, notes, and snippets.

View ngerakines's full-sized avatar
🏠
Working from home

Nick Gerakines ngerakines

🏠
Working from home
View GitHub Profile
{
"dockerComposeFile": [
"docker-compose.yml"
],
"service": "devcontainer",
"workspaceFolder": "/workspace",
}
FROM golang:alpine3.21 AS build
ENV CGO_ENABLED=1
RUN apk add --no-cache gcc musl-dev
WORKDIR /workspace
COPY go.mod /workspace/
COPY go.sum /workspace/
RUN go mod download
COPY main.go /workspace/
ENV GOCACHE=/root/.cache/go-build
RUN --mount=type=cache,target="/root/.cache/go-build" go install -ldflags='-s -w -extldflags "-static"' ./main.go
PDS_SERVICE_HANDLE_DOMAINS=.pyroclastic.cloud
PDS_HOSTNAME=pds.your-ts-net-name.ts.net
PDS_JWT_SECRET=secret
PDS_ADMIN_PASSWORD=secret
PDS_PLC_ROTATION_KEY_K256_PRIVATE_KEY_HEX=secret
[email protected]
PDS_DATA_DIRECTORY=/pds
PDS_BLOBSTORE_DISK_LOCATION=/pds/blobs
LOG_ENABLED=true
PDS_DID_PLC_URL=https://plc.your-ts-net-name.ts.net
{
"$type": "app.bsky.feed.post",
"createdAt": "2024-12-20T17:10:58.154Z",
"embed": {
"$type": "app.bsky.embed.external",
"external": {
"description": "OpenAI’s o1 model is now available in GitHub Copilot and GitHub Models, bringing advanced coding capabilities to your workflows.",
"thumb": {
"$type": "blob",
"ref": {
import json
from multiformats import multibase, multicodec
from cryptography.hazmat.primitives.asymmetric import ec
from cryptography.hazmat.primitives.serialization import (
Encoding,
PublicFormat,
PrivateFormat,
NoEncryption,
)
{
"level": 30,
"time": 1732391431648,
"pid": 7,
"hostname": "heavenly-lance",
"req": {
"id": 12,
"method": "POST",
"url": "/did:plc:wbgfwsfq2vlmsutq77hbc5eq",
"query": {},
{
email [email protected]
on_demand_tls {
ask http://127.0.0.1:3030/tls-check
}
}
*.example.com {
reverse_proxy 127.0.0.1:3000
tls {
@ngerakines
ngerakines / string_or_enum_json.rs
Last active November 11, 2024 15:20
Rust plaground code that parses json value as string or complex enum
use std::str::FromStr;
use std::fmt;
use std::marker::PhantomData;
use anyhow::anyhow;
use serde::{Deserialize, Serialize, Deserializer};
use serde::de::{self, Visitor, MapAccess};
#[derive(Clone, Debug, Deserialize, Serialize)]
#[serde(tag = "type")]
pub enum FeedQuery {
[package]
name = "corpfeeds"
version = "0.1.0"
edition = "2021"
[dependencies]
futures-util = { version = "0.3.31", features = ["sink"] }
http = "1.1.0"
serde = { version = "1.0.214", features = ["derive"] }
serde_json = "1.0.132"