Skip to content

Instantly share code, notes, and snippets.

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

Cyandev unixzii

🤔
Thinking...
View GitHub Profile
@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 / fuck-x.user.js
Last active July 31, 2023 04:09
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 / 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 / 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 / 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 / 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 {