Skip to content

Instantly share code, notes, and snippets.

@thesamesam
thesamesam / xz-backdoor.md
Last active May 4, 2024 09:26
xz-utils backdoor situation (CVE-2024-3094)

FAQ on the xz-utils backdoor (CVE-2024-3094)

This is a living document. Everything in this document is made in good faith of being accurate, but like I just said; we don't yet know everything about what's going on.

Background

On March 29th, 2024, a backdoor was discovered in xz-utils, a suite of software that

@jdgomeza
jdgomeza / 01-deployment.yaml
Last active April 3, 2024 20:22
Istio OAuth2 Envoy Filter (Okta example)
# Simple httpbin deployment
apiVersion: apps/v1
kind: Deployment
metadata:
annotations:
labels:
app: httpbin-auth
app.kubernetes.io/instance: httpbin-auth
name: httpbin-auth
spec:
@deepanchal
deepanchal / starship.toml
Last active March 29, 2024 11:51
Starship config
# Get editor completions based on the config schema
"$schema" = 'https://starship.rs/config-schema.json'
format = """
$username\
$hostname\
$localip\
$shlvl\
$singularity\
$kubernetes\
@guizmaii
guizmaii / AES.scala
Last active October 9, 2023 14:19
Pure and modern AES encryption/decryption in Scala (with PBT tests)
package com.guizmaii.utils
import java.nio.charset.{Charset, StandardCharsets}
import java.security.{Key, SecureRandom}
import cats.effect.Sync
import doobie.{Put, Read}
import eu.timepit.refined.types.all.NonEmptyString
import io.estatico.newtype.macros.newtype
import javax.crypto.{Cipher, SecretKey, SecretKeyFactory}
@april
april / arena-macos-fixes.sh
Last active March 14, 2024 04:48
Fixes Magic Arena's broken full screen implementation on macOS
# this forces Arena into full screen mode on startup, set back to 3 to reset
# note that if you go into the Arena "Graphics" preference panel, it will reset all of these
# and you will need to run these commands again
defaults write com.wizards.mtga "Screenmanager Fullscreen mode" -integer 0
defaults write com.wizards.mtga "Screenmanager Resolution Use Native" -integer 0
# you can also replace the long complicated integer bit with any other scaled 16:9
# resolution your system supports.
# to find the scaled resolutions, go to System Preferences --> Display and then
# divide the width by 16 and multiple by 9. on my personal system this ends up
@cb372
cb372 / io-and-tf.md
Last active June 5, 2023 16:16
IO and tagless final

TL;DR

We should use a type parameter with a context bound (e.g. F[_]: Sync) in library code so users can choose their IO monad, but we should use a concrete IO monad in application code.

Abstracting over IO

If you're writing a library that makes use of effects, it makes sense to use the cats-effect type classes so users can choose their IO monad (IO, ZIO, Monix Task, etc).

So instead of

@zblz
zblz / mlflow_plugin_system_proposal.md
Last active August 17, 2020 09:13
Proposal for plugin system in MLflow

Proposal for a plugin system in MLflow

Motivation

MLflow has an internally pluggable architecture to enable using different backends for both the tracking store and the artifact store. This makes it easy to add new backends in the mlflow package, but does not allow for other packages to provide new handlers for new backends.

This would be useful for several reasons:

@scmx
scmx / using-details-summary-github.md
Last active April 25, 2024 09:30
Using <details> <summary> expandable content on GitHub with Markdown #details #summary #markdown #gfm #html

How to use <details> <summary> expandable content on GitHub with Markdown

Firstly, what is <details> <summary>?

The HTML Details Element (<details>) creates a disclosure widget in which information is visible only when the widget is toggled into an "open" state. A summary or label can be provided using the <summary> element. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/details.

Example

@jdegoes
jdegoes / fpmax.scala
Created July 13, 2018 03:18
FP to the Max — Code Examples
package fpmax
import scala.util.Try
import scala.io.StdIn.readLine
object App0 {
def main: Unit = {
println("What is your name?")
val name = readLine()
@fauxpark
fauxpark / applefn.patch
Last active May 2, 2024 18:45
QMK Apple Fn
diff --git a/builddefs/common_features.mk b/builddefs/common_features.mk
index 18f8b0bbfc..4ef3e230e4 100644
--- a/builddefs/common_features.mk
+++ b/builddefs/common_features.mk
@@ -878,6 +878,10 @@ ifeq ($(strip $(JOYSTICK_ENABLE)), yes)
endif
endif
+ifeq ($(strip $(APPLE_FN_ENABLE)), yes)
+ OPT_DEFS += -DAPPLE_FN_ENABLE