Skip to content

Instantly share code, notes, and snippets.

View karnlund's full-sized avatar

Kurt Arnlund karnlund

View GitHub Profile
/// `ObjectBinding` used as a way to create a `Binding` from a `BindableObject`. In this case the ViewModel
/// complies with `BindableObject` which is then translated into a `Binding` which is what `Toggle` is expecting
/// NOTE: Since it's a `DynamicViewProperty`, after its value is changed, the body will be updated.
class ViewModel: BindableObject {
let didChange = PassthroughSubject<ViewModel, Never>()
var isEnabled = false {
didSet {
didChange.send(self)
@spikenheimer
spikenheimer / osxwikicopy.md
Last active January 19, 2016 14:24
Copy OSX Server Wiki (3.x +) to another OSX Server (3.x +)

Info gleaned from http://support.apple.com/en-us/HT5082

(note wikiadmin changed parameters between lion and ml/mavericks) and other places

####1: export wiki data on SOURCE machine

sudo wikiadmin export -name <wiki_short_name>  -path /tmp/wiki-export

####2: move that folder in some manner to your target machine

@beccadax
beccadax / NSObject+performOptionalMethod.h
Created November 7, 2012 08:18
Category to make calling optional delegate methods simpler
#import <Foundation/Foundation.h>
@protocol ADPerformOptionalMethod <NSObject>
@optional
- (instancetype)performOptionalMethod;
- (instancetype)performOptionalMethodOrReturnObject:(id)returnValue;
- (instancetype)performOptionalMethodOrReturnValue:(NSValue*)returnValue;
@mrrooijen
mrrooijen / README.md
Created October 16, 2012 22:19
Ruby Environment On Mountain Lion

Ruby Environment On Mountain Lion

A quick and easy step-by-step guide to get your Ruby environment up and running again after a fresh install of Mountain Lion. I messed up my installations a few times and figured I'd just put out a Gist once and for all to get this sucker working in one go.

The Steps

First go ahead and install either XCode to get ahold of the Command Line Tools. Or, if you prefer not to install XCode, simply download the latest version directly. This only requires you to provide your Apple ID and password to sign in. You do not need a developers license.

  1. Download the Command Line Tools
  • Or install them through XCode via the preference panel