Skip to content

Instantly share code, notes, and snippets.

View mbbx6spp's full-sized avatar
🎯
Focusing

Susan Potter mbbx6spp

🎯
Focusing
View GitHub Profile
@mbbx6spp
mbbx6spp / edts.js
Last active October 14, 2024 14:16
Using the NPM edts library to show how you might use approximate or uncertain dates in EDTF format with a supporting library contrasting it with an interval in EDTF form. Answering this tweet: https://x.com/alllexist/status/1845810486769508728
import edtf, { Date, Interval } from 'npm:[email protected]';
const approxStartDate = edtf('2024-10-14~');
const uncertainDate = edtf('2024-10-14?');
const interval = edtf('2024-10-11/2024-10-16');
console.table([
approxStartDate.edtf,
approxStartDate.min,
approxStartDate.max,

Building Docker images from Dockerfiles using conventional package management systems can lead to unpredictable results due to several factors:

  1. Version inconsistencies: Package managers often default to installing the latest versions of packages. If the Dockerfile doesn't specify exact versions, different builds at different times may pull in newer package versions, potentially introducing incompatibilities or unexpected behavior.

  2. Repository changes: Package repositories can change over time. Packages may be updated, removed, or have their dependencies modified. This can lead to build failures or different package versions being installed in subsequent builds.

  3. Caching issues: Docker uses a layer caching system to speed up builds. If a package is updated in the repository but the Docker cache still holds the old version, it may not pull the latest version unless forced to do so.

  4. Network-dependent results: The build process relies on network access to download packages. Network issues or tempor

Tools for Creating Shorts from Long-Form Videos: Pros and Cons

Pros

  1. Time-efficient: Reduces editing time
  2. Content multiplication: Repurposes existing videos
  3. Engagement boost: Short clips capture attention
  4. Brand consistency: Maintains uniform look across clips
  5. User-friendly: Accessible to editors of all skill levels
# make sure you put this in the root of the generate site build, not just in the root of your netlify repository!
/.well-known/webfinger* https://APPNAME.deno.dev/:splat 200
import cats.effect.{IO, IOApp, ExitCode}
import io.circe.generic.auto._
import org.http4s.Status._
import org.http4s.blaze.client.BlazeClientBuilder
import org.http4s.circe._
import org.http4s.client.Client
import org.http4s.syntax.all._
sealed trait IpResult
case class IpInfo(ip: String) extends IpResult

Rewriting Git history on feature branches

Assumes:

  • feature branch is feature/add_csv_file
  • mainline is deploy

If you want to rewrite Git history on your feature branch here is how to do it.

  1. Make sure you are on the branch you want to rewrite the history of:
{
name = "mbbx6spp-test";
epoch = 2021;
description = "A test of /proc fs inputs for a Hydra jobset";
inputs = {
uptime = builtins.readFile /proc/uptime;
nixpkgs.url = "github:NixOS/nixpkgs/release-21.05";
};
outputs = { self, nixpkgs, uptime }: {
checks."x86_64-linux".test = nixpkgs.hello.override { name = "hello-${uptime}"; };
let
version = {
name = "nixpkgs-21.05-darwin-20210827";
url = "https://github.com/nixos/nixpkgs.git";
rev = "9d6766c0f0b3b03bd63ffc08b2e23e476145719d";
ref = "nixpkgs-21.05-darwin";
};
jvmOverlay = self: super:
let
scala = super.scala.override { jre = self.jre_headless; };
@mbbx6spp
mbbx6spp / branded.ts
Last active August 26, 2021 22:09
A solution to the problem where you want to distinguish identical data payload at both typechecking time and provide a way to inspect that type at runtime via values in TypeScript. Leverages branded parameter types with intersection types.
type Brand<Shared, EventType> = Shared & { readonly __eventType: EventType; };
type SharedCommentEventFields = {
otherField: string;
};
type CommentFlagged = Brand<SharedCommentEventFields, 'CommentFlagged'>;
type CommentRec = Brand<SharedCommentEventFields, 'CommentRec'>;
const makeCommentFlagEvent = (eventFields: SharedCommentEventFields): CommentFlagged => (
@mbbx6spp
mbbx6spp / covidate
Last active March 11, 2023 02:40
Only shows in UTC because timezones are bullshit and I needed to pick one. Sorry. It is what my servers use.
#!/usr/bin/env bash
main() {
local -ri mar_end=1583042400
local -ri today="$(date +"%s")"
local -r dow="$(date -u +"%a")"
local -r time="$(date -u +"%T")"
local -ri secs=86400
local -ri days_since="$(( ((${today} - ${mar_end}) / ${secs}) + 1 ))"