Skip to content

Instantly share code, notes, and snippets.

View 0x1306a94's full-sized avatar
😶
depressed

0x1306a94 0x1306a94

😶
depressed
  • 05:16 (UTC +08:00)
View GitHub Profile
@0x1306a94
0x1306a94 / XcodeLLM.md
Created July 1, 2024 02:02 — forked from Kyle-Ye/XcodeLLM.md
Enable XcodeLLM for ChinaSKU Mac on macOS 15 Beta 1

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.

Step 0

Reboot into Recovery OS + Disable SIP

@0x1306a94
0x1306a94 / ChoasLinesShader.metal
Created May 22, 2024 05:05 — forked from realvjy/ChoasLinesShader.metal
Choas Lines - Metal Shader
// Lines
float hash( float n ) {
return fract(sin(n)*753.5453123);
}
// Slight modification of iq's noise function.
float noise(vector_float2 x )
{
vector_float2 p = floor(x);
vector_float2 f = fract(x);
@0x1306a94
0x1306a94 / base64_cxx_tmp.cc
Created February 18, 2023 00:16 — forked from unixzii/base64_cxx_tmp.cc
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>
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 }
@0x1306a94
0x1306a94 / libpng_test.c
Created August 25, 2022 10:01 — forked from niw/libpng_test.c
How to read and write PNG file using libpng. Covers trivial method calls like png_set_filler.
/*
* A simple libpng example program
* http://zarb.org/~gc/html/libpng.html
*
* Modified by Yoshimasa Niwa to make it much simpler
* and support all defined color_type.
*
* To build, use the next instruction on OS X.
* $ brew install libpng
* $ clang -lz -lpng16 libpng_test.c
@0x1306a94
0x1306a94 / IRMaker.cpp
Created April 21, 2022 00:23 — forked from rainyx/IRMaker.cpp
Create IR code easily
//
// Created by rainyx on 2022/4/16.
//
#include "IRMaker.h"
using namespace llvm;
using namespace std;
static bool hasTerminator(BasicBlock *BB) {
// A view that can flip between its "front" and "back" side.
//
// Animation implementation based on:
// Chris Eidhof, Keyframe animations <https://gist.github.com/chriseidhof/ea0e435197f550b195bb749f4777bbf7>
import SwiftUI
// MARK: - Chris's keyframe animation design
struct Keyframe<Data: Animatable> {
@0x1306a94
0x1306a94 / Default.swift
Created July 16, 2021 00:08 — forked from onevcat/Default.swift
Sample code of using Default to decode a property to the default value
import UIKit
protocol DefaultValue {
associatedtype Value: Decodable
static var defaultValue: Value { get }
}
@propertyWrapper
struct Default<T: DefaultValue> {
var wrappedValue: T.Value
import UIKit
class CodeTextField: UITextField, UITextFieldDelegate {
let codeLength: Int
var characterSize: CGSize
var characterSpacing: CGFloat
let textPreprocess: (String) -> String
let validCharacterSet: CharacterSet