Skip to content

Instantly share code, notes, and snippets.

View SoundBlaster's full-sized avatar
💭
Specs & Tests Driven AI Coding

Egor Merkushev SoundBlaster

💭
Specs & Tests Driven AI Coding
View GitHub Profile
@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 {
@SoundBlaster
SoundBlaster / objc.m
Created April 29, 2022 20:39
Simple multiline adjustable UILabel setup
- (void)viewDidLoad {
[super viewDidLoad];
UILabel *titleLabel = [UILabel new];
titleLabel.font = [UIFont systemFontOfSize:17];
titleLabel.numberOfLines = 3;
titleLabel.textAlignment = NSTextAlignmentCenter;
titleLabel.adjustsFontSizeToFitWidth = YES;
titleLabel.minimumScaleFactor = 0.5;
titleLabel.text = @"Sed ut perspiciatis unde omnis iste natus error sit voluptatem accusantium doloremque laudantium, totam rem aperiam, eaque ipsa quae ab illo inventore veritatis et quasi architecto beatae vitae dicta sunt explicabo.";
-(void)exportVideo
{
CGSize renderingSize = CGSizeMake(640, 360); // The desired size of your video
float displayDuration = 2.0f; //The duration of the desired video, in seconds
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *myPathDocs = [documentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"FinalVideo-%d.mov",arc4random() % 1000]];
NSURL *url = [NSURL fileURLWithPath:myPathDocs];
//
// CustomFont.swift
// BLNC
//
// Created by Egor Merkushev on 31.05.2021.
// MIT
// Source: https://stackoverflow.com/a/58971579/602249
import SwiftUI
@SoundBlaster
SoundBlaster / SwiftUI.playground
Last active November 10, 2021 21:45
Empty View as last item in SwiftUI List
import SwiftUI
struct ContentView: View {
var body: some View {
NavigationView {
ZStack {
List {
ForEach(1..<20) { idx in
if idx == 19 {
https://www.osstatus.com
-12884 - Media File not received
code -1008, underlying -12884 - Playlist File not received
-11819 AVErrorMediaServicesWereReset with NSOSStatusErrorDomain Code=-12178, solution: rebuild AVPlayer|Item and asset
-11847 AVFoundationErrorDomain H.264 decoding layer has failed, "Operation Interrupted" Error Domain=NSOSStatusErrorDomain Code=-12084 The operation couldn’t be completed https://stackoverflow.com/questions/28841903/why-does-avsamplebufferdisplaylayer-fail-with-operation-interrupted-11847
HTTP | errorStatusCode | errorDomain | errorComment