Skip to content

Instantly share code, notes, and snippets.

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

Fero ferologics

🔥
🔆 〰️ 🌑
View GitHub Profile
@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 November 13, 2022 22:40
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 March 24, 2024 05:52
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 February 13, 2024 08:00
SwiftUI: discover underlying components to fill in gaps in SwiftUI api
import SwiftUI
extension View {
public func discover<T: UIView>(
tag: Int = .random(in: (.min)...(.max)),
where predicate: @escaping (T) -> Bool = { _ in true },
_ closure: @escaping (T) -> Void
) -> some View {
self.overlay(
DiscoveryView(tag: tag)
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)
}

FB7671513

If you run the code below in a playground you will see that tapping the buttons doesn’t change the UI.

However, if you move the GeometryReader to the outside of ViewModelView it will begin working again.

import SwiftUI
import PlaygroundSupport