Skip to content

Instantly share code, notes, and snippets.

View mbbx6spp's full-sized avatar
🎯
Focusing

Susan Potter mbbx6spp

🎯
Focusing
View GitHub Profile

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 ))"
@mbbx6spp
mbbx6spp / Functor.purs
Last active December 24, 2020 21:41
Fast and loose reasoning as to why Functor and Cofunctor are the same. I have to answer this when coworkers as why Comonads are also Functors and not Cofunctors.
-- Informally showing that Cofunctor is essentially the same structure as Functor thus why Comonads are a Functor which is
-- effectively a Cofunctor.
-- In PureScript Functor is defined here: https://pursuit.purescript.org/packages/purescript-prelude/4.1.1/docs/Data.Functor#t:Functor
-- class Functor (f :: Type -> Type) where
-- map :: forall a b. (a -> b) -> f a -> f b
-- Informally: Making a dual of something is basically flipping the arrows. But to make is easier to see, let's flip the
-- arguments of map in Functor definition since that shouldn't change anything, like so: