This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef TESTING | |
/* | |
Disable deprecated-declarations warning. | |
See http://clang.llvm.org/docs/UsersManual.html#diagnostics_pragmas | |
Basic workflow: | |
1. push current warnings onto stack | |
2. ignore warning we know will get thrown | |
3. do dodgy thing that causes warning |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifdef TESTING | |
/* | |
Disable deprecated-declarations warning. | |
See http://clang.llvm.org/docs/UsersManual.html#diagnostics_pragmas | |
Basic workflow: | |
1. push current warnings onto stack | |
2. ignore warning we know will get thrown | |
3. do dodgy thing that causes warning |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Ordinarily I would go into Keyboard Preferences, Modifier Keys; I would select the name of the external keyboard | |
and I would tell it to turn Command into Option, Option into Command, and Caps Lock into Control. | |
But the Varmilo VB87M Mechanical Bluetooth Tenkeyless doesn't show up as an external keyboard. Weird, right? | |
You can't just swap command and option globally or your local keyboard will be affected. | |
When I added it, I had to "add Bluetooth device" under Bluetooth preferences, | |
rather than "add Bluetooth keyboard" under Keyboard preferences. | |
(That was true, at least, as of 2016-08-24, on OS X El Capital 10.11.6.) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct TextSize { | |
fileprivate struct CacheEntry: Hashable { | |
let text: String | |
let font: UIFont | |
let width: CGFloat | |
let insets: UIEdgeInsets | |
fileprivate var hashValue: Int { | |
return text.hashValue ^ Int(width) ^ Int(insets.top) ^ Int(insets.left) ^ Int(insets.bottom) ^ Int(insets.right) |
Principles of Adult Behavior
- Be patient. No matter what.
- Don’t badmouth: Assign responsibility, not blame. Say nothing of another you wouldn’t say to him.
- Never assume the motives of others are, to them, less noble than yours are to you.
- Expand your sense of the possible.
- Don’t trouble yourself with matters you truly cannot change.
- Expect no more of anyone than you can deliver yourself.
- Tolerate ambiguity.
- Laugh at yourself frequently.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#Whenever you clone a repo, you do not clone all of its branches by default. | |
#If you wish to do so, use the following script: | |
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master | grep -v main `; do | |
git branch --track ${branch#remotes/origin/} $branch | |
done |
Probably one of the easiest things you'll ever do with gpg
Install Keybase: https://keybase.io/download and Ensure the keybase cli is in your PATH
First get the public key
keybase pgp export | gpg --import
Next get the private key
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private func with<T: NSView>(_ value: T, _ builder: (T) -> Void) { | |
builder(value) | |
} | |
private func with<T: NSView>(_ value: T, _ builder: (T) throws -> Void) rethrows { | |
try builder(value) | |
} | |
// Use | |
with(self.collectionView) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// ExtensionURLRequest.swift | |
// | |
// Created by Abhishek Maurya on 16/07/20. | |
// Copyright © 2020. All rights reserved. | |
// | |
import Foundation | |
extension URLRequest { |
OlderNewer