This is a work in progress, proceed with caution
- Install Proxmox 6.X iso I selected 2 drives in Raid 1 mirror
- Console/SSH into Proxmox
- nano /etc/apt/sources.list
import lldb | |
def __lldb_init_module(debugger, internal_dict): | |
debugger.HandleCommand('command script add -f SwiftPrinter.printer pjson') | |
def printer(debugger, command, result, internal_dict): | |
debugger.HandleCommand('p print(String(data: try! JSONSerialization.data(withJSONObject:' + command + ', options: .prettyPrinted), encoding: .utf8 )!)') |
extension Data { | |
init?(hexString: String) { | |
let count = hexString.count / 2 | |
var data = Data(capacity: count) | |
var i = hexString.startIndex | |
for _ in 0 ..< count { | |
let j = hexString.index(after: i) | |
if var byte = UInt8(hexString[i ... j], radix: 16) { | |
data.append(&byte, count: 1) | |
} else { |
extension Color { | |
/// Return a random color | |
static var random: Color { | |
return Color( | |
red: .random(in: 0...1), | |
green: .random(in: 0...1), | |
blue: .random(in: 0...1) | |
) | |
} | |
} |
@propertyWrapper | |
public final class LayoutInvalidating<Value> where Value: Equatable { | |
public static subscript<EnclosingSelf>( | |
_enclosingInstance observed: EnclosingSelf, | |
wrapped wrappedKeyPath: ReferenceWritableKeyPath<EnclosingSelf, Value>, | |
storage storageKeyPath: ReferenceWritableKeyPath<EnclosingSelf, LayoutInvalidating> | |
) -> Value where EnclosingSelf: UIView { | |
get { | |
return observed[keyPath: storageKeyPath].stored |
#!/bin/sh | |
# make sure you have imagemagick installed: brew install imagemagick | |
# your app_icons.sh file should have the correct permissions: run `chmod 775 app_icons.sh` in your terminal from where you put this file | |
# put your `my_icon.png` next to this file and run ./app_icons.sh to export your app icons | |
x=my_icon.png | |
y=${x%.*} | |
# delete the export directory so we start clean |
#!/usr/bin/awk -f | |
# This program is a copy of guff, a plot device. https://github.com/silentbicycle/guff | |
# My copy here is written in awk instead of C, has no compelling benefit. | |
# Public domain. @thingskatedid | |
# Run as awk -v x=xyz ... or env variables for stuff? | |
# Assumptions: the data is evenly spaced along the x-axis | |
# TODO: moving average |
command alias objc expression -l objc -O -- | |
command regex swift 's#(.+)#expression -l Swift -O -- defer { CATransaction.flush() }; %1#' | |
breakpoint set -n AppDelegate.application --one-shot true --auto-continue true | |
breakpoint command add | |
swift import Foundation | |
swift import UIKit | |
swift import MyApp_tvOS | |
swift import MyApp_iOS | |
swift func $printSubviews(of view: UIView) { print(view.perform("recursiveDescription")!) } |
//: A UIKit based Playground for presenting user interface | |
import UIKit | |
import PlaygroundSupport | |
final class SampleCollectionReusableView: UICollectionReusableView { | |
private let titleLabel = UILabel() | |
override init(frame: CGRect) { | |
super.init(frame: frame) |
import Foundation | |
enum BetterDecodingError: CustomStringConvertible { | |
case dataCorrupted(_ message: String) | |
case keyNotFound(_ message: String) | |
case typeMismatch(_ message: String) | |
case valueNotFound(_ message: String) | |
case any(_ error: Error) |