Skip to content

Instantly share code, notes, and snippets.

View ferologics's full-sized avatar
🔥
🔆 〰️ 🌑

Fero ferologics

🔥
🔆 〰️ 🌑
View GitHub Profile
@boxabirds
boxabirds / .cursorrules
Last active June 29, 2025 05:46
Rock solid: turn Cursor into a rock-solid software engineering companion
# Project Policy
This policy provides a single, authoritative, and machine-readable source of truth for AI coding agents and humans, ensuring that all work is governed by clear, unambiguous rules and workflows. It aims to eliminate ambiguity, reduce supervision needs, and facilitate automation while maintaining accountability and compliance with best practices.
# 1. Introduction
> Rationale: Sets the context, actors, and compliance requirements for the policy, ensuring all participants understand their roles and responsibilities.
## 1.1 Actors
@MarkTanashchuk
MarkTanashchuk / config.toml
Created April 17, 2023 01:13
Helix Colemak config
theme = "catppuccin_mocha"
[editor]
cursorline = true
color-modes = true
[editor.lsp]
display-inlay-hints = true
[editor.soft-wrap]
@phranck
phranck / PlatformVisibility.swift
Last active August 30, 2024 00:05
A Swift view modifier to handle visibility of views for specific platforms
import SwiftUI
public struct Platform: OptionSet {
public var rawValue: UInt8
public static let iOS = Platform(rawValue: 1 << 0)
public static let macOS = Platform(rawValue: 1 << 1)
public static let tvOS = Platform(rawValue: 1 << 2)
public static let watchOS = Platform(rawValue: 1 << 3)
public static let all: Platform = [.iOS, .macOS, .tvOS, .watchOS]
@snowzurfer
snowzurfer / 3DPointsFromDepth.swift
Last active July 12, 2024 07:39
3D world points from ARKit depth
import ARKit
import SceneKit
let horizontalPoints = 256 / 2
let verticalPoints = 192 / 2
var depthNodes = [SCNNode]()
var parentDebugNodes = SCNNode()
var sceneView: ARSCNView!
// Somewhere during setup
@McFrappe
McFrappe / set_theme.vim
Last active April 25, 2022 21:00
Set VIM theme depending on OS theme mode. Checks OSX value `AppleInterfaceStyle` and acts accordingly.
" COLORS AND THEMING ##########################################################
function! SetBackgroundMode(...)
let g:new_bg = "light"
let g:ayucolor = "light" # If your theme supports light mode
let s:mode = systemlist("defaults read -g AppleInterfaceStyle")[0]
if s:mode ==? "Dark"
let g:ayucolor = "dark" # If your theme supports dark mode
let g:new_bg = "dark"
endif

[fit] Algebra to

[fit] (Co)monads


$$Cᴮᴬ = (Cᴮ)ᴬ$$


$$Cᴮᴬ = (Cᴮ)ᴬ$$

$$Pair&lt;A,B&gt; → C ≅ A → B → C$$

@IanKeen
IanKeen / View+Discover.swift
Last active July 22, 2024 04:23
SwiftUI: discover underlying components to fill in gaps in SwiftUI api
import SwiftUI
extension View {
public func discover<T: UIView>(
where predicate: @escaping (T) -> Bool = { _ in true },
_ closure: @escaping (T) -> Void
) -> some View {
overlay(
DiscoveryView(predicate: predicate, setup: closure)
.frame(width: 0, height: 0)
require 'optimist'
require 'plist'
# Setups of source path mapping for the framework at framework_path,
# which has a dsym at dsym_path. It maps the source paths to the
# source_path root. Implementation borrowed from https://medium.com/@maxraskin/background-1b4b6a9c65be
def setup_dsym_source_mapping(framework_path, dsym_path, source_path)
binary_uuids = get_uuids_of_dwarf(framework_path)
dsym_uuids = get_uuids_of_dwarf(dsym_path)
verify_uuids(binary_uuids, dsym_uuids)
//
// ContentView.swift
// ScrollViewDemo
//
// Created by MC on 2020/7/5.
//
import SwiftUI
struct ContentView: View {
@mjm
mjm / LinkedText.swift
Created May 21, 2020 03:56
Tappable links in SwiftUI Text view
import SwiftUI
private let linkDetector = try! NSDataDetector(types: NSTextCheckingResult.CheckingType.link.rawValue)
struct LinkColoredText: View {
enum Component {
case text(String)
case link(String, URL)
}