Skip to content

Instantly share code, notes, and snippets.

View max-potapov's full-sized avatar
🌴
On vacation

Maxim V. Potapov max-potapov

🌴
On vacation
View GitHub Profile
@max-potapov
max-potapov / tdd.swift
Created April 9, 2018 05:29
TDD intro playground
//: Playground - noun: a place where people can play
import Foundation
import XCTest
let fullname = "John Doe"
let age = 42
let me = false
@max-potapov
max-potapov / split.swift
Created July 14, 2019 16:47
Split single column list to two columns list
let list = raw.components(separatedBy: "\n")
let limit = list.count/2
var formatted = ""
for (index, item) in list.enumerated() {
guard index < limit else { continue }
formatted.append(item)
formatted.append("\t")
formatted.append(list[index + limit])
formatted.append("\n")
}
#!/bin/sh
pushd /Applications/Microsoft\ Defender.app/Contents/MacOS/
sudo chmod -x *
pushd /Library/Managed\ Preferences/
# TODO: update to new location
sudo su root -c "plutil -replace antivirusEngine.passiveMode -bool true com.microsoft.wdav.plist"
sudo su root -c "plutil -replace antivirusEngine.enableRealTimeProtection -bool false com.microsoft.wdav.plist"
import Foundation
import RealmSwift
final class Task: Object {
@Persisted var id: String = ""
@Persisted var title: String = ""
@Persisted var text: String = ""
override static func primaryKey() -> String? { "id" }
}