Skip to content

Instantly share code, notes, and snippets.

View unixzii's full-sized avatar
🤔
Thinking...

Cyandev unixzii

🤔
Thinking...
View GitHub Profile
@unixzii
unixzii / skill-extract-car-images.md
Created April 21, 2026 11:07
Use this skill when you need to build or explain a macOS-only tool that extracts image assets from an Apple asset catalog `.car` file.
name extract-car-images
description Use this skill when you need to build or explain a macOS-only tool that extracts image assets from an Apple asset catalog `.car` file.
version 1.0.0

Extract CAR Images

Use this skill when the user needs the core capability of exporting all image resources from an Apple .car asset catalog. The intended environment is macOS with Objective-C tooling available. This skill is about reproducing the capability, not reproducing any specific project structure.

@unixzii
unixzii / dock-memory.py
Created January 17, 2025 06:15
A program that memorizes your dock size
#!/usr/bin/env python3
import sys
import subprocess
import ctypes
import argparse
hi_dll = ctypes.CDLL('/System/Library/Frameworks/ApplicationServices.framework/ApplicationServices')
def save_dock_size():
@unixzii
unixzii / ForceEnablingXcodeLLM.md
Last active April 15, 2026 08:06
A guide to force enabling Xcode LLM feature on China-SKU Macs.

Introduction

Apple restricted the access to Xcode LLM (Predictive code completion) feature on China models of Mac. This guide provides a way to bypass that restriction. It's verified on macOS 15.0 Beta (24A5264n), but there is no guarentee that it will always work on later macOS versions.

Prerequisites

  • Xcode is installed and run at least once.
  • SIP debugging restrictions are disabled (via csrutil enable --without debug command in recovery mode).

Disclaimer

@unixzii
unixzii / trapping_rain_water_tmp.cc
Last active March 30, 2024 07:28
A "Trapping Rain Water" implementation using C++ template metaprogramming.
template <int, typename>
struct List;
struct Nil {
template <int _NValue>
using Append = List<_NValue, Nil>;
};
template <int _Value, typename _Next>
struct List {
@unixzii
unixzii / ContentView.swift
Last active March 30, 2024 08:36
GPU particle system using Metal.
import SwiftUI
struct SmashableView: NSViewRepresentable {
typealias NSViewType = _SmashableNSView
let text: String
class _SmashableNSView: NSView {
@unixzii
unixzii / WKWebView+InputAccessory.h
Created December 8, 2023 05:10
A drop-in utility to customize input accessory view for `WKWebView`.
#import <WebKit/WebKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface WKWebView (InputAccessory)
@property (nonatomic, nullable, setter=cy_setCustomInputAccessoryView:) UIView *cy_customInputAccessoryView;
@end
@unixzii
unixzii / WeatherView.swift
Created November 7, 2023 13:21
A demo of implementing iOS Weather card in SwiftUI.
import SwiftUI
struct HeaderView: View {
var body: some View {
HStack {
Image(systemName: "info.circle.fill")
.resizable()
.frame(width: 12, height: 12)
Text("Section Header")
.font(.system(size: 13))
@unixzii
unixzii / fuck-x.user.js
Last active September 27, 2024 05:18
Tampermonkey userscript to rescue your X (formerly Twitter) experience.
// ==UserScript==
// @name Fuck X
// @namespace http://tampermonkey.net/
// @version 0.1
// @description Save your eyes while using X (formerly Twitter)
// @author Cyandev <unixzii@gmail.com>
// @match https://twitter.com/*
// @grant none
// ==/UserScript==
@unixzii
unixzii / base64_cxx_tmp.cc
Last active February 18, 2023 06:44
A Base64 implementation using C++ template metaprogramming.
template<auto... Val>
struct List;
template<>
struct List<> {
template<auto Elem>
using Append = List<Elem>;
};
template<auto Head, auto... _Rest>
@unixzii
unixzii / dock_actions.m
Last active November 4, 2022 04:45
Perform some of Dock actions programmatically.
#import <dlfcn.h>
void sendMessageToDock(NSString *message) {
static dispatch_once_t onceToken;
static void (*ptrCoreDockSendNotification)(CFStringRef, int) = NULL;
dispatch_once(&onceToken, ^{
void *handle = dlopen("/System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/HIServices.framework/Versions/A/HIServices", RTLD_LAZY);
if (!handle) {
return;
}