Skip to content

Instantly share code, notes, and snippets.

View robnadin's full-sized avatar

Rob Nadin robnadin

  • Dyson
  • Bristol, UK
  • 02:35 (UTC +01:00)
  • X @robnadin
View GitHub Profile
@robnadin
robnadin / install_rbenv.sh
Last active October 7, 2021 09:30 — forked from 0xmachos/install_rbenv.sh
Install the Ruby version manager rbenv and ruby-build to allow you to install Ruby versions
#!/usr/bin/env bash
set -eo pipefail
# -e exit if any command returns non-zero status code
# -o pipefail force pipelines to fail on first non-zero status code
FATAL="\\033[1;31mFATAL\\033[0m"
WARNING="\\033[1;33mWARNING\\033[0m"
PASS="\\033[1;32mPASS\\033[0m"
INFO="\\033[1;36mINFO\\033[0m"
@robnadin
robnadin / convert.sh
Created October 9, 2021 12:38
Convert universal(fat) frameworks to XCFrameworks
#!/usr/bin/env zsh
set -eo pipefail
# -e exit if any command returns non-zero status code
# -o pipefail force pipelines to fail on first non-zero status code
declare -a frameworks=("Bold360AI" "BoldAIAccessibility" "BoldAIEngine" "BoldCore" "BoldEngine")
# Create directories
mkdir -p iphoneos
@robnadin
robnadin / Podfile
Created August 10, 2022 23:07
Native Xcode w/ Intel iOS Simulator on Apple Silicon
post_install do |installer|
installer.pods_project.build_configurations.each do |config|
config.build_settings["EXCLUDED_ARCHS[sdk=iphonesimulator*]"] = "arm64"
end
end
import SwiftUI
public struct DoubleColumnVStackLayout: Layout {
private let alignment: HorizontalAlignment
private let spacing: CGFloat?
public init(alignment: HorizontalAlignment = .center, spacing: CGFloat? = nil) {
self.alignment = alignment
self.spacing = spacing
@robnadin
robnadin / RegularExpression.swift
Created July 19, 2024 09:53
Adds dynamic member lookup of captures when matching regular expressions using the RegexBuilder API
import os
import RegexBuilder
public struct RegularExpression<Output, Captures> {
fileprivate let references = References<Captures>()
fileprivate let regex: Regex<Output>
public init(for capturesType: Captures.Type = Captures.self, @RegexComponentBuilder _ content: (References<Captures>) -> some RegexComponent<Output>) {
let components = content(references)
import RegexBuilder
extension Regex {
/// Transforms the output of a regex component using the provided transformation function.
///
/// - Parameter transform: A closure that takes the output of the regex and transforms it to a new output type.
/// - Returns: A new `Regex` instance that applies the transformation function to its output.
public func mapOutput<NewOutput>(_ transform: @escaping (Output) throws -> NewOutput) -> Regex<NewOutput> {
Regex<NewOutput> {
@robnadin
robnadin / gist:ff44561034e4ef06711d97aba66c78a8
Last active April 15, 2025 09:03
WoW macro for Soar + Summon Random Favourite Mount. Put Soar on a free action bar slot and use /fstack to find out the exact button name, replacing "MultiBarRightButton10" in the macro below with the actual name that is provided to you.
#showtooltip Soar
/click [nomounted,advflyable,flyable] MultiBarRightButton10; MountJournalSummonRandomFavoriteButton