I hereby claim:
- I am mainasuk on github.
- I am mainasuk (https://keybase.io/mainasuk) on keybase.
- I have a public key ASAsqiEANz0eSQXHxi1YjIBC1m9lm3k8TldYLv-HRafSHAo
To claim this, I am signing this object:
########### | |
# general # | |
########### | |
# Replace C-b prefix with Alt+Space (so it won't clash with vim) | |
unbind C-b | |
set-option -g prefix M-Space | |
set-window-option -g mode-keys vi | |
set-option -g default-shell /usr/local/bin/fish |
Apps made available through the App Store are licensed, not sold, to you. Your license to each App is subject to your prior acceptance of either this Licensed Application End User License Agreement (“Standard EULA”), or a custom end user license agreement between you and the Application Provider (“Custom EULA”), if one is provided. Your license to any Apple App under this Standard EULA or Custom EULA is granted by Apple, and your license to any Third Party App under this Standard EULA or Custom EULA is granted by the Application Provider of that Third Party App. Any App that is subject to this Standard EULA is referred to herein as the “Licensed Application.” The Application Provider or Apple as applicable (“Licensor”) reserves all rights in and to the Licensed Application not expressly granted to you under this Standard EULA. | |
a. Scope of License: Licensor grants to you a nontransferable license to use the Licensed Application on any Apple-branded products that you own or control and as permitted by the Usag |
<#subview#>.translatesAutoresizingMaskIntoConstraints = false | |
addSubview(<#subview#>) | |
NSLayoutConstraint.activate([ | |
<#subview#>.topAnchor.constraint(equalTo: topAnchor), | |
<#subview#>.leadingAnchor.constraint(equalTo: leadingAnchor), | |
trailingAnchor.constraint(equalTo: <#subview#>.trailingAnchor), | |
bottomAnchor.constraint(equalTo: <#subview#>.bottomAnchor), | |
]) |
#!/usr/bin/swift | |
import Foundation | |
class Bash { | |
static var debugEnabled = false | |
// save command search time | |
static var commandCache: [String: String] = [:] | |
@discardableResult |
final class ViewModel: NSObject { | |
@objc var tree: [Node] = [] | |
override init() { | |
super.init() | |
} | |
} |
let stream = CGDisplayStream(display: CGDirectDisplayID(), outputWidth: 1, outputHeight: 1, pixelFormat: Int32(kCVPixelFormatType_32BGRA), properties: nil, handler: { (status, time, surface, update) in | |
// do nothing | |
}) |
import Cocoa | |
#if canImport(SwiftUI) && DEBUG | |
import SwiftUI | |
struct NSViewControllerPreview<ViewController: NSViewController>: NSViewControllerRepresentable { | |
let viewController: ViewController | |
init(_ builder: @escaping () -> ViewController) { | |
viewController = builder() |
I hereby claim:
To claim this, I am signing this object:
import UIKit | |
@UIApplicationMain | |
class AppDelegate: UIResponder, UIApplicationDelegate { | |
var window: UIWindow? | |
func application(_ application: UIApplication, didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?) -> Bool { | |
// Set up application here |
It often be helpful to be able to debug memory usage in Swift on Linux, for example to debug memory leaks.
This is a quick overview of how to generate a report of memory usage for your Swift app. This guide will only show you how to generate the report, not how to analyze it, it might be written up in a blog post later.
First we need to install a tool called Valgrind, which is used to trace memory usage.