Skip to content

Instantly share code, notes, and snippets.

View mflknr's full-sized avatar
🌿
Eat RAM not animals

Marius Felkner mflknr

🌿
Eat RAM not animals
View GitHub Profile
@mflknr
mflknr / pre-commit.sh
Created February 27, 2024 12:43
pre-commit hook for running SwiftLint and SwiftFormat on changed files
#!/bin/bash
SWIFT_LINT=/opt/homebrew/bin/swiftlint
SWIFT_LINT_CONFIG=.swiftlint.yml
SWIFT_FORMAT=/opt/homebrew/bin/swiftformat
CHANGED_FILES="$(git --no-pager diff --name-status --no-color --cached | awk '$1 != "D" && $NF ~ /\.swift?$/ { print $NF }')"
if [[ -e "${SWIFT_LINT}" || -e "${SWIFT_FORMAT}" ]]; then
count=0
@mflknr
mflknr / PreviewExt.swift
Last active October 19, 2023 20:46
Convenience extension for SwiftUI previews.
//
// PreviewExt.swift
//
//
// Created by Marius Felkner on 2021-11-15.
//
// The MIT License (MIT)
//
// Copyright (c) 2021 Marius Felkner (https://twitter.com/mflknr)
//
@mflknr
mflknr / setup.sh
Last active August 12, 2022 19:39
MacOS initial development setup and installation
#!/bin/zsh
# Run with
# `sudo curl -s https://gist.githubusercontent.com/mflknr/927f9dfc87592bd08a87e116ca7408be/raw/f8c8bf14f1e4a51107feb764db39c33e36e2575c/setup.sh | zsh`
set -e
# install command line tools
xcode-select --install
echo 'Waiting for Command Line Tools to finish installing. \nAfter installation is complete, press any key to continue...'; read -k1 -s
@mflknr
mflknr / Taiga.xccolortheme
Last active October 13, 2021 09:19
Taiga - Xcode ColorTheme
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>0.816187 0.837374 0.894673 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>SFMono-Bold - 11.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>0.816187 0.837374 0.894673 1</string>