Skip to content

Instantly share code, notes, and snippets.

View quernd's full-sized avatar
😺

Daniel Quernheim quernd

😺
View GitHub Profile
@fogus
fogus / juxt.bib
Last active December 24, 2024 12:02
@book {Arbib-Manes:75,
AUTHOR = "Arbib, M. and Manes, L.",
TITLE = "Arrows, Structures and Functors:
The Categorical Imperative",
NOTE = "Home library",
PUBLISHER = "Academic Press",
YEAR = 1975}
@incollection{Backus-etal:90,
AUTHOR = "J.W. Backus and J. Williams and E.W. Wimmers",
TITLE = "An Introduction to the programming Language {FL}",
@wokalski
wokalski / k.sh
Created July 31, 2022 10:30
Boundary Kubectl connect with persistent sessiosn
#!/bin/zsh
PID_FILE="$HOME/.boundary_session_ttcp_BRTTDbGBAK"
connect() {
echo "Inititating a boundary session to k8s..."
TMP_FILE=$(mktemp)
nohup -- boundary connect -target-id ttcp_BRTTDbGBAK -format json &> $TMP_FILE &
CONNECT_PID=$!
@m3hrdadfi
m3hrdadfi / create_wav2vec2.py
Last active February 27, 2024 06:50
Pytorch Wav2vec2 Mobile Version
import soundfile as sf
import torch
from transformers import Wav2Vec2ForCTC, Wav2Vec2Processor
from torch.utils.mobile_optimizer import optimize_for_mobile
model_name_or_path = "m3hrdadfi/wav2vec2-large-xlsr-persian-v2"
# tokenizer = Wav2Vec2Tokenizer.from_pretrained(model_name_or_path)
processor = Wav2Vec2Processor.from_pretrained(model_name_or_path)
model = Wav2Vec2ForCTC.from_pretrained(model_name_or_path)
@cdepillabout
cdepillabout / shell.nix
Last active April 12, 2025 10:52
shell.nix for Python development using virtualenv and pip
let
nixpkgs-src = builtins.fetchTarball {
# master of 2021-01-05.
url = "https://github.com/NixOS/nixpkgs/archive/1a57d96edd156958b12782e8c8b6a374142a7248.tar.gz";
sha256 = "1qdh457apmw2yxbpi1biwl5x5ygaw158ppff4al8rx7gncgl10rd";
};
pkgs = import nixpkgs-src {
config = {
# allowUnfree may be necessary for some packages, but in general you should not need it.
@malhal
malhal / CLLocationManager+Combine.swift
Last active April 17, 2025 18:20
A Combine location publisher for CLLocationManager.
// Requirements: a NSLocationWhenInUseUsageDescription entry in Info.plist
// Usage: @State var locator = CLLocationManager.publishLocation()
// and
// .onReceive(locator) { location in
// Improvements needed: Move requestWhenInUseAuthorization into its own publisher and perhaps have a combineLatest pipeline for both authorized and valid location.
// A configuration param to init(), e.g. so each manager can have the same distanceFilter.
import Foundation
import Combine
import CoreLocation
@DanielKotik
DanielKotik / summary.md
Last active October 3, 2024 14:08
Jupyter kernel for pipenv
@awni
awni / ctc_decoder.py
Last active February 2, 2025 12:53
Example CTC Decoder in Python
"""
Author: Awni Hannun
This is an example CTC decoder written in Python. The code is
intended to be a simple example and is not designed to be
especially efficient.
The algorithm is a prefix beam search for a model trained
with the CTC loss function.
@mjambon
mjambon / ocaml_lwt_sample.ml
Last active May 29, 2022 19:59
OCaml/Lwt crash course. Adult supervision recommended.
(*
Interactive approach
--------------------
You can copy-paste code into `utop`, provided you load the lwt.unix
package:
#use "topfind";;
#thread;; (* only needed in the plain `ocaml` toplevel, not in `utop`. *)
#require "lwt.unix";;
@CodaFi
CodaFi / Aviary.swift
Last active May 20, 2025 02:16
Fly my pretties
// Playground - noun: a place where people can play
// I wouldn't want a pair of birds that were... too demonstrative.
func idiot<A>(a : A) -> A {
return a
}
func kestrel<A, B>(a : A) -> B -> A {
return { _ in a }