Skip to content

Instantly share code, notes, and snippets.

View mkll's full-sized avatar
😎

Alex Sherbakov mkll

😎
  • Home Sweet Home
View GitHub Profile

What's new in Swift 6 (Swiftify article translated into Russian)

Что нового в Swift 6 (перевод статьи Swiftify)

Apple планирует выпустить Swift 6 в сентябре 2024 года наряду с Xcode 16. Это будет первое крупное обновление Swift за последние пять лет, начиная с Swift 5. Этот выпуск приурочен к 10-летнему юбилею Swift. За эти годы Swift значительно развился, от простого улучшения Objective-C до безопасного, многофункционального и производительного языка, который легко использовать.

Apple ранее упоминала, что будут последовательно выпускаться версии Swift 5.x, вводящие инкрементальные изменения и новые функции для подготовки к Swift 6. Основные цели включали улучшение поддержки параллелизма и модели владения памятью. На данный момент они были достигнуты в значительной степени.

Давайте кратко вспомним эволюцию версий Swift

@mkll
mkll / elementaryos.md
Created February 5, 2024 21:46 — forked from NathanSkene/elementaryos.md
elementaryOS | Things To Do After Installing Elementary OS Loki [Best OS For Switching From Windows & Mac]

FIRST THING FIRST


  • Update OS
sudo apt-get update && sudo apt-get upgrade

@mkll
mkll / csrutil.md
Last active January 28, 2024 21:17

Monterey 12.1 beta sets csrutil disable on Mac hardware like this:

Current Configuration:

Kext Signing			1 	[--without kext]	        CSR_ALLOW_UNTRUSTED_KEXTS
Filesystem Protections		1 	[--without fs]		        CSR_ALLOW_UNRESTRICTED_FS
Debugging Restrictions		1 	[--without debug]	        CSR_ALLOW_TASK_FOR_PID
Kernel Debugging Restrictions	1 	<n/a>			        CSR_ALLOW_KERNEL_DEBUGGER
Apple Internal			0 	[--no-internal]		        CSR_ALLOW_APPLE_INTERNAL
DTrace Restrictions 1 [--without dtrace] CSR_ALLOW_UNRESTRICTED_DTRACE
import CIconv
#if os(Linux)
import Glibc
#endif
enum Charset {
case utf8
case koi8r
case cp1251
case cp866
@mkll
mkll / brew-bundle-brewfile-tips.md
Created January 11, 2024 23:07 — forked from ChristopherA/brew-bundle-brewfile-tips.md
Brew Bundle Brewfile Tips

Brew Bundle Brewfile Tips

Copyright & License

Unless otherwise noted (either in this file or in a file's copyright section) the contents of this gist are Copyright ©️2020 by Christopher Allen, and are shared under spdx:Creative Commons Attribution Share Alike 4.0 International (CC-BY-SA-4.) open-source license.

Sponsor

If you more tips and advice like these, you can become a monthly patron on my GitHub Sponsor Page for as little as $5 a month; and your contributions will be multipled, as GitHub is matching the first $5,000! This gist is all about Homebrew, so if you like it you can support it by donating to them or becoming one of their Github Sponsors.

@mkll
mkll / ExifData.swift
Created July 31, 2023 02:18 — forked from lukebrandonfarrell/ExifData.swift
A Swift class for extracting exif data from URL, UIImage or Data types 🔭
//
// ExifData.swift
// Qeepsake
//
// Created by Luke Farrell on 26/05/2022.
//
import Foundation
import ImageIO
@mkll
mkll / 1_JSONifyTag.swift
Created March 11, 2023 18:49 — forked from vzsg/1_JSONifyTag.swift
Custom Leaf tag for printing anything in the context as JSON (Vapor 4)
import LeafKit
final class JSONifyTag: UnsafeUnescapedLeafTag {
func render(_ ctx: LeafContext) throws -> LeafData {
guard let param = ctx.parameters.first else {
throw "no parameter provided to JSONify"
}
return LeafData.string(param.jsonString)
}
@mkll
mkll / 1_Vapor+Proto.swift
Created February 15, 2023 16:28 — forked from vzsg/1_Vapor+Proto.swift
Using SwiftProtobuf with Vapor 3
import Vapor
import SwiftProtobuf
import Foundation
extension Request {
public func decodeMessage<M: SwiftProtobuf.Message>(_ type: M.Type = M.self) throws -> M {
let data = http.body.data ?? Data()
if http.contentType == MediaType.json {
return try M(jsonUTF8Data: data)
@mkll
mkll / libdispatch-efficiency-tips.md
Created February 15, 2023 16:25 — forked from tclementdev/libdispatch-efficiency-tips.md
Making efficient use of the libdispatch (GCD)

libdispatch efficiency tips

The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).

My take-aways are:

  • You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.

  • Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse

@mkll
mkll / openconnect_vpn.zsh
Created March 14, 2022 21:13 — forked from edgar/openconnect_vpn.zsh
ZSH functions to start/stop OpenConnect
#
# ZSH functions to start/stop OpenConnect VPN client
#
# In my setup the VPN username is the same as $USER
#
export VPN_HOST=<your VPN host>
function vpn-up() {
if [[ -z $VPN_HOST ]]
then