Examples for how to create your own info panel, warning box and other decent looking notification in GitHub markdown.
All the boxes are single/two cell tables or two row tables.
❗ You have to read about this |
---|
import Foundation | |
extension Data { | |
var prettyPrintedJSONString: NSString? { /// NSString gives us a nice sanitized debugDescription | |
guard let object = try? JSONSerialization.jsonObject(with: self, options: []), | |
let data = try? JSONSerialization.data(withJSONObject: object, options: [.prettyPrinted]), | |
let prettyPrintedString = NSString(data: data, encoding: String.Encoding.utf8.rawValue) else { return nil } | |
return prettyPrintedString | |
} |
/// If an error occurs while getting the amount of memory used, the first returned value in the tuple will be 0. | |
func getMemoryUsedAndDeviceTotalInMegabytes() -> (Float, Float) { | |
// https://stackoverflow.com/questions/5887248/ios-app-maximum-memory-budget/19692719#19692719 | |
// https://stackoverflow.com/questions/27556807/swift-pointer-problems-with-mach-task-basic-info/27559770#27559770 | |
var used_megabytes: Float = 0 | |
let total_bytes = Float(ProcessInfo.processInfo.physicalMemory) |
// | |
// ExtensionURLRequest.swift | |
// | |
// Created by Abhishek Maurya on 16/07/20. | |
// Copyright © 2020. All rights reserved. | |
// | |
import Foundation | |
extension URLRequest { |
These instructions will guide you through the process of setting up local, trusted websites on your own computer.
These instructions are intended to be used on Mac OSX Yosemite.
NOTE: You may substitute the edit
command for nano
, vim
, or whatever the editor of your choice is. Personally, I forward edit
to Sublime Text:
alias edit="/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl"
po [[UIWindow keyWindow] _autolayoutTrace] // prints layouts ambiguity | |
po [view constraintsAffectingLayoutForAxis:0] // horizontal | |
po [view constraintsAffectingLayoutForAxis:1] // vertical | |
[view hasAmbiguousLayout] // BOOL | |
[view exerciseAmbiguityInLayout] // visualizing ambiguity | |
viewController.extendedLayoutIncludesOpaqueBars = NO; | |
viewController.automaticallyAdjustsScrollViewInsets = NO; | |
viewController.edgesForExtendedLayout = UIRectEdgeNone; |