Skip to content

Instantly share code, notes, and snippets.

View CreatorMetaSky's full-sized avatar
🎯
Focusing

MetaSky CreatorMetaSky

🎯
Focusing
  • Earth
View GitHub Profile
@mbrandonw
mbrandonw / 66629.md
Last active August 16, 2023 11:09
WWDC 2023 Feedbacks

Cannot use #if canImport with @ObservationIgnored

@DougGregor
DougGregor / macros-dashboard.md
Last active May 18, 2024 11:19
Swift Macros Dashboard

Swift Macros Dashboard

Macros are a power feature in a number of programming languages that make the language more extensible. Swift has always sought to enable expressive libraries through its use of type inference, generics, and general approach toward clarity of use. Macros in Swift are intended to improve expressiveness without sacrificing clarity.

This gist provides a "dashboard" with links to the various documents and example projects that are part of the Swift Macros effort. Head on over to the Swift Forums if you have questions!

Overview and examples:

  • Macros vision document: lays out the overall motivation, goals, and approach we're taking in the implementation of macros in Swift.
  • Example macros repository: contains a number of example macros that demonstrate the capabilities of the macro system and how it integrates into the language. This
@DougGregor
DougGregor / macros.md
Last active October 24, 2023 16:42
A possible vision for macros in Swift

A Possible Vision for Macros in Swift

As Swift evolves, it gains new language features and capabilities. There are different categories of features: some fill in gaps, taking existing syntax that is not permitted and giving it a semantics that fit well with the existing language, with features like conditional conformance or allowing existential values for protocols with Self or associated type requirements. Others introduce new capabilities or paradigms to the language, such as the addition of concurrency or comprehensive reflection.

There is another large category of language features that provide syntactic sugar to eliminate common boilerplate, taking something that can be written out in long-form and making it more concise. Such features don't technically add any expressive power to the language, because you can always write the long-form version, but their effect can be transformational if it enables use cases that would otherwise have been unwieldy. The synthesis of Codable conformances, for ex

@xqm32
xqm32 / clash-config.yaml
Last active October 6, 2024 11:02
clash config with proxy-providers and rule-providers
##### 使用说明 #####
# 1. 请填写 proxy-providers - subscribe - url 为订阅链接
# 2. 下载 https://github.com/Loyalsoldier/clash-rules/archive/refs/heads/release.zip 并解压至 ./profiles/ruleset 文件夹下
# 3. 若需要自动更新 ruleset, 请编辑 rule-providers-config - type 为 http
##### 参考链接 #####
# 1. clash 样例配置文件
# https://lancellc.gitbook.io/clash/clash-config-file/an-example-configuration-file
# 2. clash 规则集
# https://github.com/Loyalsoldier/clash-rules
@floooh
floooh / zig_test_debugging_vscode.md
Last active September 2, 2024 16:41
How to debug Zig tests in VSCode

Tested on macOS:

  1. Install the CodeLLDB VSCode extension. Unlike the debugger in the C/C++ extension, this allows to set breakpoints inside Zig "test" blocks (in the MS C/C++ extension debugger, breakpoints inside test blocks will be disabled once the debugger starts for unknown reasons.
  2. When compiling the test, tell it to also emit a binary: zig test -femit-bin=zig-out/bin/my-test src/bla.zig, otherwise there will be no executable to debug.
  3. The compiled test executable expects the path to the Zig executable as first command line argument, the launch.json file needs to be setup accordingly (note the args item):
@DougGregor
DougGregor / SwiftConcurrencyDependencies.svg
Created December 2, 2020 00:39
Swift Concurrency Proposal Dependencies
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@chriseidhof
chriseidhof / swiftui.swift
Last active March 15, 2023 06:53
SwiftUI - iOS
import Combine
import CoreFoundation
import CoreGraphics
import CoreText
import Darwin
import Foundation
import SwiftUI
import UIKit
import os.log
import os
@Muscliy
Muscliy / mac-cheatsheet.markdown
Last active November 6, 2024 01:39
你每天都在使用的 Mac 键盘,其实还暗藏了这些秘密

这些技巧,能让工作效率更上一个台阶

键盘,可以算是最传统的输入设备之一。在计算机尚未诞生时,就已被广泛地用在打字机上。即使是在交互方式不断突破的今天,没人能够否认,传统的键盘依然处在人机交互的中心地位。我们使用电脑的绝大部分时间都是在敲击键盘中度过的,键盘使用的熟练度和舒适度直接影响着工作效率。因此,了解、熟练使用、甚至根据个体需求改造键盘,往往能够极大的提升工作效率。在本文中,笔者将将结合自己的使用经验,探讨一些能够提升 macOS 系统的键盘使用效率的方法与技巧。

被遗忘的 Control (⌃) 与 Option (⌥)

几乎所有对 macOS 系统有一定了解的用户都知道,macOS 的系统快捷键是以 Command (⌘) 为中心的。实际上,Control 键和 Option 键也暗藏不少秘密。

Control (⌃)

@lattner
lattner / TaskConcurrencyManifesto.md
Last active November 18, 2024 17:28
Swift Concurrency Manifesto