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) {
private func with<T: NSView>(_ value: T, _ builder: (T) throws -> Void) rethrows {
try builder(value)
// Use
with(self.collectionView) {
wilmarvh /
Created May 3, 2019 — forked from webframp/
Signing git commits on github using gpg key

Probably one of the easiest things you'll ever do with gpg

Install Keybase: 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
#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

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 ( on keybase.
* I have a public key ASA9ll0ZgdRn_JGzrjaoCJzqo71fhEmDL_3g_bGdrjELygo
To claim this, I am signing this object:
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( ^ Int(insets.left) ^ Int(insets.bottom) ^ Int(insets.right)
View EdgeMAX Router VPN l2tp-ipsec
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
set vpn l2tp remote-access client-ip-pool stop
set vpn l2tp remote-access dns-servers server-1
View Bluetooth stutter commands
defaults write "Apple Bitpool Max (editable)" 80
defaults write "Apple Bitpool Min (editable)" 48
defaults write "Apple Initial Bitpool (editable)" 40
defaults write "Negotiated Bitpool" 58
defaults write "Negotiated Bitpool Max" 58
defaults write "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 /
Created Apr 6, 2016 — forked from kevin-smets/
iTerm2 + oh my zsh + solarized + Meslo powerline font (OSX)
You can’t perform that action at this time.