Skip to content

Instantly share code, notes, and snippets.

@SoundBlaster
SoundBlaster / SwiftUIApp.swift
Last active July 29, 2025 20:41
Qwen3-30b-a3b-2507-4bit
// MIT Licence
//
// LLM: qwen/qwen3-30b-a3b-2507
//
// Software: LMStudio
//
// Prompt in 3 steps:
// 1. I want to built simple SwiftUI app in one file. Help
// 2. Please, return only code in the markdown markup. No comments, no detail text.
// Make this app more complex - add several buttons and functions for them.
@SoundBlaster
SoundBlaster / NSProxyInSwift.swift
Last active November 30, 2023 11:43
Base example for NSProxy in Swift
// Objective-C Header BaseProxyForSwift.h
NS_ASSUME_NONNULL_BEGIN
NS_SWIFT_NAME(BaseProxyForSwift)
@interface BaseProxyForSwift : NSProxy
+ (id)with:(id)object;
@end
@SoundBlaster
SoundBlaster / swift.swift
Last active November 29, 2023 11:01
Swift Generic constrained by Protocol
// protocols
protocol Connection {
init()
}
protocol Factory<T> {
associatedtype T: Connection
func create() -> T
}
@SoundBlaster
SoundBlaster / BorderedRectangle.swift
Last active September 29, 2023 18:54
SwiftUI Rectangle with outside border and inner gradient shadow
import SwiftUI
import PlaygroundSupport
struct RoundedRect: View {
var body: some View {
RoundedRectangle(cornerRadius: 8, style: .continuous)
.fill(.blue.opacity(0))
.overlay(
ZStack {
RoundedRectangle(cornerRadius: 8, style: .continuous)
@SoundBlaster
SoundBlaster / ffmpeg
Last active June 2, 2023 21:30
ffmpeg cheatsheet
Конвертация MKV в MP4
ffmpeg -i sme.mkv -codec copy MmZdigKm2ls.mp4
ffmpeg -i 1.avi -c:v libx264 -c:a aac 1.mp4
ffmpeg -i MmZdigKm2ls.mkv -c copy MmZdigKm2ls.mp4
ffmpeg -i MmZdigKm2ls.mkv -c:v libx264 -c:a copy -x264-params crf=25 MmZdigKm2ls.mp4
WEBM в MP4
ffmpeg -fflags +genpts -i 11.webm -r 24 1.mp4
MKV в MP4 с HDR 10
@SoundBlaster
SoundBlaster / SafeRefreshable.swift
Created January 18, 2023 17:21
SafeRefreshable modifier for crossplatform SwiftUI
//
// SafeRefreshable.swift
// BLNC
//
// Created by Egor Merkushev on 23.01.2022.
// Copyright © 2022 Egor Merkushev. All rights reserved.
//
import SwiftUI
@SoundBlaster
SoundBlaster / FontsSwiftUI.swift
Created August 24, 2022 23:40
Custom Dynamic Font for SwiftUI
//
// CustomFont.swift
// BLNC
//
// Created by Egor Merkushev on 31.05.2021.
// Copyright © 2021 Egor Merkushev. All rights reserved.
// Source: https://stackoverflow.com/a/58971579/602249
import SwiftUI
//
// ContentView.swift
// NewNav
//
// Created by Egor Merkushev on 15.06.2022.
//
import SwiftUI
struct CustomColorCategory: Identifiable, Hashable, Equatable {
@SoundBlaster
SoundBlaster / SplitView_ContentView.swift
Last active June 16, 2022 14:07
NavigationSplitView with default selection | SwiftUI WWDC 2022
//
// ContentView.swift
// NewNav
//
// Created by Egor Merkushev on 15.06.2022.
//
import SwiftUI
struct CustomColorCategory: Identifiable, Hashable, Equatable {
@SoundBlaster
SoundBlaster / ContentView.swift
Last active June 18, 2022 18:27
WWDC 2022 Split View for three column proper usage
//
// ContentView.swift
// NewNav
//
// Created by Egor Merkushev on 15.06.2022.
//
import SwiftUI
struct CustomColorCategory: Identifiable, Hashable, Equatable {