Warning
The following guide need to disable SIP to work.
Please confirm the risk of disabling the SIP by yourself.
Another solution which does not require disabling SIP is currently under investigation.
Reboot into Recovery OS + Disable SIP
| #!/usr/bin/env python | |
| import os | |
| import sys | |
| import glob | |
| from mars_utils import * | |
| SCRIPT_PATH = os.path.split(os.path.realpath(__file__))[0] |
Swift Macro分为两部分,一部分为宏的具体实现(编译器插件),一部分为Macro Lib用于导出宏定义以及所需要的附属代码,这里说的不使用SPM指的是编译器插件这部分Xcode使用SPM集成Macro时,在编译命令中通过-load-plugin-executable参数指定了对应宏实现的插件可执行文件路径swift源码中也找到了相关参数TypeCheckMacros.cpp TypeCheckMacros.cppswift源码中可得知,宏实现插件即可以是动态库(dylib)也可以是可执行文件-plugin-path <dylib path> 加载Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/Lib/swift/host/pluginsSPM也可以直接通过Xcode创建命令行程序项目,完成宏实现代码编写| // source https://github.com/TenniS-Open/TenniS/blob/ef6c8332809a021d0eb5842c0f9d32a7f0b07f96/include/kernels/common/simd_def/simd_base_def.h | |
| #ifndef TENSORSTACK_KERNELS_COMMON_SIMD_DEF_SIMD_MACOS_DEF_H | |
| #define TENSORSTACK_KERNELS_COMMON_SIMD_DEF_SIMD_MACOS_DEF_H | |
| #ifdef TS_USE_MACOS_SIMD | |
| #include <simd/vector.h> | |
| typedef struct _simd_f32x4x3 { | |
| simd_float4 val[3]; | |
| } _simd_f32x4x3; |
| // | |
| // main.cpp | |
| // FaceFeaturesCompare | |
| // | |
| // Created by king on 2023/5/13. | |
| // | |
| #include <chrono> | |
| #include <ctime> | |
| #include <iostream> |
| use core::slice; | |
| use std::alloc::{alloc, dealloc, Layout}; | |
| use std::cmp::min; | |
| const DEFAULT_UNIT_SIZE: usize = 128; | |
| #[derive(Debug)] | |
| pub enum Seek { | |
| Start, | |
| Cur, |
| template<auto... Val> | |
| struct List; | |
| template<> | |
| struct List<> { | |
| template<auto Elem> | |
| using Append = List<Elem>; | |
| }; | |
| template<auto Head, auto... _Rest> |
| import Foundation | |
| class Throttle { | |
| private let queue: DispatchQueue | |
| private let delay: Double | |
| private var delayedBlock: (() -> Void)? | |
| private var cancelBlock: (() -> Void)? | |
| private var timer: DispatchSourceTimer? | |
| private var isReady = true | |
| private var hasDelayedBlock: Bool { delayedBlock != nil } |
| // ==UserScript== | |
| // @name 谷歌翻译绕过代码块(适配github,mathworks等) | |
| // @version 0.4 | |
| // @description 让谷歌翻译插件翻译网页的时候,绕过代码块和一些无需翻译的元素 | |
| // @match http*://*/* | |
| // @match http*://*:*/* | |
| // @match http://localhost:*/* | |
| // @match http://127.0.0.1:*/* | |
| // @match http://[::]:*/* | |
| // @license MIT |