Skip to content

Instantly share code, notes, and snippets.

import SwiftUI
import PlaygroundSupport
struct MultiSegmentPickerViewModel {
typealias Label = String
typealias Selection = Binding<Int>
typealias PickerDisplayValues = [String]
let segments: [(Label, Selection, PickerDisplayValues)]
}
@voynovia
voynovia / iOSActivityRingSwiftUI.swift
Created August 11, 2020 20:08 — forked from frankfka/iOSActivityRingSwiftUI.swift
iOS Activity Ring in SwiftUI
import SwiftUI
import PlaygroundSupport
extension Double {
func toRadians() -> Double {
return self * Double.pi / 180
}
func toCGFloat() -> CGFloat {
return CGFloat(self)
@voynovia
voynovia / MacEditorTextView.swift
Created March 16, 2020 20:50 — forked from unnamedd/MacEditorTextView.swift
[SwiftUI] MacEditorTextView - A simple and small NSTextView wrapped by SwiftUI.
/**
* MacEditorTextView
* Copyright (c) Thiago Holanda 2020
* https://twitter.com/tholanda
*
* MIT license
*/
import Combine
import SwiftUI
import Foundation
import JSON
let FILE_BUFFER_SIZE = 50000
// source data
struct DebtRec {
var company: String
var phones: Array<String>
var debt: Double
@voynovia
voynovia / dante-compose.yml
Created April 16, 2018 14:28
Dante - A free SOCKS server
version: "3"
services:
proxy:
image: vimagick/dante
restart: always
ports:
- "1080:1080"
command: >
@voynovia
voynovia / rocket-compose.yml
Last active September 5, 2018 07:06
Rocket.Chat
version: "3"
services:
mongodb:
image: mongo:latest
ports:
- "27017:27017"
command: "--smallfiles --auth"
environment: