Skip to content

Instantly share code, notes, and snippets.

Working from home

Sergey Vinogradov w-i-n-s

Working from home
  • Varna, Bulgaria
View GitHub Profile
w-i-n-s / ContentView.swift
Last active Jun 16, 2021
SwiftUI Multidestination NavigationLink
View ContentView.swift
// Edited by me. Cos I need custom back button
// Origin
// Adult router
enum NavigationTag {
case Second
case Third
struct ContentView: View {

Keybase proof

I hereby claim:

  • I am w-i-n-s on github.
  • I am w_i_n_s ( on keybase.
  • I have a public key ASAfAgeYghcRjorMz0tjptfZYBm6hHcVEooxVF0Pb56uNQo

To claim this, I am signing this object:

w-i-n-s / BasicAuth.playground
Created Jun 7, 2019
Boilerplate for Basic auth
View BasicAuth.playground
import Foundation
import PlaygroundSupport
PlaygroundPage.current.needsIndefiniteExecution = true
struct WebPage {
let user: String
let password: String
let urlString: String
w-i-n-s /
Created May 30, 2019 — forked from adrienjoly/
Mac Os X command to restart the core audio. I needed to use this in order to fix my AirPlay issue.
# You have to restart the core audio be pasting the following line into termnal
sudo kill `ps -ax | grep 'coreaudiod' | grep 'sbin' |awk '{print $1}'`
View iOS standart sounds
w-i-n-s / PHPhotoLibrary+SaveImage
Created Dec 12, 2018 — forked from khorbushko/PHPhotoLibrary+SaveImage
PHPhotoLibrary+SaveImage - save image with Photos Framework swift 3
View PHPhotoLibrary+SaveImage
import UIKit
import Photos
extension PHPhotoLibrary {
// MARK: - PHPhotoLibrary+SaveImage
// MARK: - Public
func savePhoto(image:UIImage, albumName:String, completion:((PHAsset?)->())? = nil) {
func save() {
w-i-n-s / CustomActivity.swift
Last active Dec 18, 2017 — forked from shu223/CustomActivity.swift
Custom UIActivity in Swift 3
View CustomActivity.swift
import UIKit
class CustomActivity: UIActivity {
var actName = ""
var actImage: UIImage?
var customActionWhenTapped:( ()-> Void)!
init(title: String, image: UIImage, performAction: @escaping (() -> ()) ) {
self.actName = title
self.actImage = image
w-i-n-s / cmakeAndTaglib
Created Nov 15, 2017 — forked from phatfly/cmakeAndTaglib
compile taglib for iOS
View cmakeAndTaglib
I wanted to document the process that I went through to compile taglib for my iOS project.
At the time of this writing I used TagLib 1.9.1
1. Download taglib at:
2. Download ios-make at:
3. The ios-make file that you need is in the toolchain directory. Copy the whole directory “toolchain” from inside the ios-make directory to taglib directory.
w-i-n-s / IntroViewController.m
Created Jun 14, 2017
UIAlertController with dictionary and blocks
View IntroViewController.m
- (IBAction)tamLanguageChangeButton:(id)sender {
__weak __typeof(self)weakSelf = self;
UIAlertController *alert;
// if user vill tap to already selected language
void (^cancelBlock)(UIAlertAction * _Nonnull action) = ^(UIAlertAction * _Nonnull action) {
dispatch_async(dispatch_get_main_queue(), ^{
[weakSelf dismissViewControllerAnimated:YES completion:nil];
View resize video
- (void)fixVideoUrl:(NSURL *)url completion:(void (^)(NSURL *outputUrl))completion {
// output file
NSString* docFolder = [NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject];
NSString* outputPath = [docFolder stringByAppendingPathComponent:@""];
if ([[NSFileManager defaultManager] fileExistsAtPath:outputPath]) {
[[NSFileManager defaultManager] removeItemAtPath:outputPath error:nil];
// input file
AVAsset* asset = [AVAsset assetWithURL:url];