Skip to content

Instantly share code, notes, and snippets.

View jmfigueroa's full-sized avatar

Jose Figueroa jmfigueroa

View GitHub Profile
import whisperx
import torch
from pydub import AudioSegment
import os
import time
script_start_time = time.perf_counter()
LANGUAGE_CODE = "en"
HF_TOKEN="YOUR_TOKEN_HERE"
@mjkstra
mjkstra / arch_linux_installation_guide.md
Last active May 5, 2026 20:59
A modern, updated installation guide for Arch Linux with BTRFS on an UEFI system
@yakushevichsv
yakushevichsv / AtomicPropertyWrapper.swift
Created September 5, 2021 09:41
Atomic Property Wrapper Using Unfair Lock
// MARK: - Atomic
@propertyWrapper struct Atomic<T> {
private let lock = UnfairLock()
private var value: T
var wrappedValue: T {
get {
lock.lock()
defer {
import Foundation
struct Post: Decodable {
let id: String
let title: String
let body: String
}
struct GraphQLResult<T: Decodable>: Decodable {
let object: T?
@0xLeif
0xLeif / metal_01_swiftui.swift
Last active May 6, 2023 11:47
Metal + SwiftUI
//
// ContentView.swift
// MetalSwiftUI
//
// Created by Zach Eriksen on 9/8/20.
// Copyright © 2020 oneleif. All rights reserved.
//
// Inspired [MetalUI](https://github.com/0xLeif/MetalUI)
import SwiftUI
// Based on this StackOverflow answer: https://stackoverflow.com/a/61273595/4239752
import Foundation
import Combine
extension Publisher {
/// collects elements from the source sequence until the boundary sequence fires. Then it emits the elements as an array and begins collecting again.
func buffer<T: Publisher, U>(_ boundary: T) -> AnyPublisher<[Output], Failure> where T.Output == U {
let subject = PassthroughSubject<[Output], Failure>()
// The SwiftUI Lab
// Website: https://swiftui-lab.com
// Article: https://swiftui-lab.com/alignment-guides
import SwiftUI
class Model: ObservableObject {
@Published var minimumContainer = true
@Published var extendedTouchBar = false
@Published var twoPhases = true
@nil-biribiri
nil-biribiri / RealmManager.swift
Created April 11, 2019 10:30
Realm manager for Swift 5.0
import Realm
import RealmSwift
class RealmManager {
static let shared = RealmManager()
private func getRealm() -> Realm {
if let _ = NSClassFromString("XCTest") {
return try! Realm(configuration: Realm.Configuration(fileURL: nil, inMemoryIdentifier: "test", encryptionKey: nil, readOnly: false, schemaVersion: 0, migrationBlock: nil, objectTypes: nil))
} else {
@norsez
norsez / JSONSaveLoad.swift
Created May 7, 2018 04:47
Load and Save JSON objects into a local file (written in Swift)
import Foundation
/**
Extension to save/load a JSON object by filename. (".json" extension is assumed and automatically added.)
*/
extension JSONSerialization {
static func loadJSON(withFilename filename: String) throws -> Any? {
let fm = FileManager.default