Skip to content

Instantly share code, notes, and snippets.

/*
* Copyright 2026 Kyriakos Georgiopoulos
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@brianmwadime
brianmwadime / README.md
Created February 21, 2026 08:06 — forked from kktse/README.md
Installing brlaser CUPS drivers for printing on Apple Silicon Macs and Brother printers

Installing brlaser CUPS drivers for printing on Apple Silicon Macs and Brother printers

Problem

You own a Mac running MacOS and want to print a document using a Brother printer. You also prefer not to use MacPorts because you have another package manger installed.

Environment

  • I used a 2021 Macbook Pro 14" running Sonoma 14.0
  • I am using Homebrew as a package manager
@brianmwadime
brianmwadime / bash.sh
Created March 25, 2024 15:38
Silicon - install: you may need to run ldconfig
sudo update_dyld_shared_cache
\documentclass[11pt, oneside]{article}
\usepackage[margin=0.5in]{geometry}
\geometry{letterpaper}
\usepackage[parfill]{parskip}
\usepackage{graphicx}
\usepackage{amssymb}
\usepackage{xcolor}
\pagecolor{white}
\usepackage[colorlinks = true, linkcolor = blue, urlcolor = blue]{hyperref}
\pagestyle{empty}
@brianmwadime
brianmwadime / TextFieldWithBackoff.kt
Created November 23, 2023 21:55 — forked from nemscep/TextFieldWithBackoff.kt
TextField which automatically triggers provided `onValueChange` lambda with the full text input (not for every character).
import androidx.compose.foundation.interaction.MutableInteractionSource
import androidx.compose.foundation.shape.ZeroCornerSize
import androidx.compose.foundation.text.KeyboardActions
import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.LocalTextStyle
import androidx.compose.material.MaterialTheme
import androidx.compose.material.TextField
import androidx.compose.material.TextFieldColors
import androidx.compose.material.TextFieldDefaults
import androidx.compose.runtime.Composable
@brianmwadime
brianmwadime / CurrencyOffsetMapping.kt
Created November 23, 2023 21:25 — forked from damianpetla/CurrencyOffsetMapping.kt
Transforming EditText value into currency
import androidx.compose.ui.text.input.OffsetMapping
class CurrencyOffsetMapping(originalText: String, formattedText: String) : OffsetMapping {
private val originalLength: Int = originalText.length
private val indexes = findDigitIndexes(originalText, formattedText)
private fun findDigitIndexes(firstString: String, secondString: String): List<Int> {
val digitIndexes = mutableListOf<Int>()
var currentIndex = 0
for (digit in firstString) {

https://groups.google.com/forum/#!topic/comp.sys.mac.system/jIWY8VRl3cw

Recommended "vm_compressor=2" or "vm_compressor=4".

Compressor mode 4 (VM compressed + swap) and all the steps between 1st-4th descripted before, is equal than compressor mode 2 (VM compressed/encrypted without swap).

In compressor mode 1, if you disable swap, system is always 100% memory pressure, and if memory is full at some point, the system will freeze.

So i recommended mode 2 or 4 with steps to disable swap applied.

@brianmwadime
brianmwadime / AsyncSequence-subprotocol-try-await-element-type.swift
Created May 2, 2023 06:29 — forked from inamiy/AsyncSequence-subprotocol-try-await-element-type.swift
AsyncSequence subprotocol with primary associated type, erase with existential, and check try-await element type
import Foundation
import _Concurrency
extension AsyncStream {
public init<S: AsyncSequence & Sendable>(
_ sequence: S,
bufferingPolicy limit: Continuation.BufferingPolicy = .unbounded
) where S.Element == Element {
self.init(bufferingPolicy: limit) { continuation in
let task = Task {
@brianmwadime
brianmwadime / README.md
Created October 20, 2022 22:06 — forked from dylangolow/README.md
Postman Pre-Request script for Firebase Auth

Postman Pre-Request Script to fetch Firebase Auth token

This pre-request script uses environment variables to fetch an auth JWT.

This Auth JWT is used in the header of all requests when testing API endpoints that use Firebase for authorization.