Skip to content

Instantly share code, notes, and snippets.

View wilmarvh's full-sized avatar
💻

Wilmar van Heerden wilmarvh

💻
View GitHub Profile
#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
#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
@wilmarvh
wilmarvh / validate_xcode.sh
Created September 30, 2015 08:34
Validate Xcode version
spctl --assess --verbose /Applications/Xcode.app
@wilmarvh
wilmarvh / iterm2-solarized.md
Created April 6, 2016 13:00 — forked from kevin-smets/iterm2-solarized.md
iTerm2 + oh my zsh + solarized + Meslo powerline font (OSX)

Solarized

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.)
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
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
@wilmarvh
wilmarvh / TextSize.swift
Created April 8, 2017 20:08 — forked from gnou/TextSize.swift
Calculate height of some text when width is fixed
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)
### 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:

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.