Skip to content

Instantly share code, notes, and snippets.

View oozoofrog's full-sized avatar

oozoofrog oozoofrog

View GitHub Profile
final class PreviewView: UIView, LayoutBuilding {
var capTop = true {
didSet {
UIView.animate(withDuration: 1.0) {
self.updateLayout()
}
}
}
@oozoofrog
oozoofrog / NotificationCenter+Concurrency.swift
Last active December 24, 2022 13:02
disposable notification
public extension NotificationCenter {
private class FirstReceiver: NSObject {
let notificationName: Notification.Name
init(_ name: Notification.Name) {
notificationName = name
super.init()
}
@oozoofrog
oozoofrog / NotificationConcurrencyTests.swift
Last active December 24, 2022 05:31
NotfiicationCenter+Concurrency test case
extension Notification.Name {
static let testNotification: Notification.Name = .init("TestNotification")
}
final class NotificationConcurrencyTests: XCTestCase {
func testWaitNotification() async throws {
let expect = XCTestExpectation(description: "DisposableNotification")
let queue = DispatchQueue(label: "test", attributes: .concurrent)
for _ in 0...10 {
try:
import lldb
except:
pass
import textwrap
import hashlib
from collections import namedtuple
object_register = ""
@oozoofrog
oozoofrog / wwdc2024.py
Last active June 26, 2024 17:34
WWDC 2024 download video and subtitle and merge and translation script
import sys
import requests
import yt_dlp
import openai
def get_best_format(m3u8_url):
ydl_opts = {
'listformats': True,
}