Skip to content

Instantly share code, notes, and snippets.

💻

Wilmar van Heerden wilmarvh

💻
Block or report user

Report or block wilmarvh

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View with.swift
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) {
@wilmarvh
wilmarvh / keybase.md
Created May 3, 2019 — forked from webframp/keybase.md
Signing git commits on github using keybase.io gpg key
View keybase.md

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

View git checkout-all-branches.sh
#!/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 `; do
git branch --track ${branch#remotes/origin/} $branch
done
View Principles-of-Adult-Behavior.md

Principles of Adult Behavior

  1. Be patient. No matter what.
  2. Don’t badmouth: Assign responsibility, not blame. Say nothing of another you wouldn’t say to him.
  3. Never assume the motives of others are, to them, less noble than yours are to you.
  4. Expand your sense of the possible.
  5. Don’t trouble yourself with matters you truly cannot change.
  6. Expect no more of anyone than you can deliver yourself.
  7. Tolerate ambiguity.
  8. Laugh at yourself frequently.
View gist:2813d55738bd74f70af6d55539a5cef5
### Keybase proof
I hereby claim:
* I am wilmarvh on github.
* I am wilmarvh (https://keybase.io/wilmarvh) on keybase.
* I have a public key ASA9ll0ZgdRn_JGzrjaoCJzqo71fhEmDL_3g_bGdrjELygo
To claim this, I am signing this object:
@wilmarvh
wilmarvh / TextSize.swift
Created Apr 8, 2017 — forked from gnou/TextSize.swift
Calculate height of some text when width is fixed
View TextSize.swift
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)
View EdgeMAX Router VPN l2tp-ipsec
In CLI:
configure
set vpn l2tp remote-access authentication mode local
set vpn l2tp remote-access authentication local-users username <username> password <password>
set vpn l2tp remote-access client-ip-pool start 10.0.0.195
set vpn l2tp remote-access client-ip-pool stop 10.0.0.199
set vpn l2tp remote-access dns-servers server-1 10.0.0.1
View Bluetooth stutter commands
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Max (editable)" 80
defaults write com.apple.BluetoothAudioAgent "Apple Bitpool Min (editable)" 48
defaults write com.apple.BluetoothAudioAgent "Apple Initial Bitpool (editable)" 40
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool" 58
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Max" 58
defaults write com.apple.BluetoothAudioAgent "Negotiated Bitpool Min" 48
View How to Swap Command and Option for Mac on the Varmilo VB87M Bluetooth Mechanical Keyboard
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.)
@wilmarvh
wilmarvh / iterm2-solarized.md
Created Apr 6, 2016 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + oh my zsh + solarized + Meslo powerline font (OSX)
You can’t perform that action at this time.