Skip to content

Instantly share code, notes, and snippets.

@awni
awni / mlx_lm_open_webui.md
Created April 25, 2025 15:41
Open WebUI with MLX LM

Setup

Install packages:

pip install open-webui mlx-lm

Start Open WebUI server:

@cassidoo
cassidoo / simple-react-recorder.jsx
Last active August 11, 2025 19:03
A simple React microphone component, recording audio and showing the blob in the browser, styled with Tailwind.
"use client";
import { useState, useEffect, useRef } from "react";
function SimpleRecordButton() {
const [isRecording, setIsRecording] = useState(false);
const [audioStream, setAudioStream] = useState(null);
const [mediaRecorder, setMediaRecorder] = useState(null);
const [audioBlob, setAudioBlob] = useState(null);
const [recordingTime, setRecordingTime] = useState(0);
const timerRef = useRef(null);
@Anakiev2
Anakiev2 / How to install nvidia-legacy-340xx-driver (or nvidia-legacy-390xx-driver) on Debian 12 Bookworm.md
Last active August 20, 2025 07:36
How to install nvidia-legacy-340xx-driver on Debian 12 Bookworm

How to install nvidia-legacy-340xx-driver on Debian 12 Bookworm

This guide will show you how to download, compile and install the nvidia-legacy-340xx-driver on Debian 12. Some people install the driver directly from sid but this will mix packages from both stable and unstable which may create issues. It's recommended to update and upgrade your system before you start.

It was reported to work with nvidia-legacy-390xx-driver just replace the appropriate package names.

Step 1. Download the source code.

Install these packages.

sudo apt install build-essential fakeroot devscripts
@alexweberk
alexweberk / mlx_finetuning_gemma.ipynb
Last active August 19, 2025 15:09
MLX Fine-tuning Google Gemma
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
//
// VolumePopupView.swift
//
// Created by Alex Rosenberg on 1/24/24.
//
import SwiftUI
import AVFoundation
import MediaPlayer
@kamilogorek
kamilogorek / _screenshot.md
Last active May 29, 2025 21:24
Clutter-free VS Code Setup
image
local wezterm = require 'wezterm'
local themes = {}
for k, _ in pairs(wezterm.get_builtin_color_schemes()) do
table.insert(themes, k)
end
local fav_themes = {
"SweetTerminal (Gogh)",
"PaulMillr",
@marcoarment
marcoarment / S3.php
Last active July 8, 2025 17:39
A simple PHP class to perform basic operations against Amazon S3 and compatible services.
<?php
/*
A simple PHP class to perform basic operations against Amazon S3 and compatible
services. Requires modern PHP (7+, probably) with curl, dom, and iconv modules.
Copyright 2022 Marco Arment. Released under the MIT license:
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
@PierBover
PierBover / index.md
Last active April 23, 2025 07:47
Reading waveform data in ffmpeg

Reading waveform data in ffmpeg

When working on an audio player, I wanted to extract the audio waveform data to paint the audio waveform dynamically in the browser on a <canvas> element.

Initially I used the bbc/audiowaveform package but this proved problematic for a number of reasons. First I wasn't able to install that package (or build the binary) in macOS for local dev. The other big issue is that I was only able to figure out how to install it on Ubuntu, so I couldn't use it in Alpine (for Docker images) or other environments like cloud functions.

Initial approach

I found out from these docs it's possible to paint a waveform with ffmpeg by extracting raw audio data:

@jeroenvollenbrock
jeroenvollenbrock / aws-cloudfront-basic-auth.js
Last active June 26, 2024 13:36
AWS-CloudFront-basic-auth
var USERS = {
protecteddir: [{
username: 'user',
password: 'pass',
}],
};
//Response when auth is not valid.
var response401 = {
statusCode: 401,