This file contains hidden or 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
import Foundation | |
public typealias UserInfo = [NSObject : AnyObject] | |
public protocol DomainEvent { | |
class var eventName: String { get } | |
init(userInfo: UserInfo) | |
func userInfo() -> UserInfo | |
} |
This file contains hidden or 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
import Cocoa | |
// MARK: Part of Your New Toolkit | |
func bind<T, U>(optional: T?, f: T -> U?) -> U? { | |
if let x = optional { | |
return f(x) | |
} | |
else { |
This file contains hidden or 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
import Foundation | |
// Application Service, responsible for transactions | |
class CreateGroupedMonitor { | |
// Domain Services: | |
let monitoringService: MonitorFile | |
let monitorMovalService: MoveMonitor | |
init(monitoringService: MonitorFile, groupCreationService: CreateGroup, monitorMovalService: MoveMonitor, updateSchedule: UpdateSchedule, wordCountStrategyRegistry: WordCountStrategyRegistry, monitorRepository: MonitorRepository) { |
This file contains hidden or 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
import Foundation | |
public struct Subscription<State: Any> { | |
let subscriber: AnyStoreSubscriber | |
let selector: (State -> Any) | |
init(aSubscriber: AnyStoreSubscriber) { | |
This file contains hidden or 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
# A sample Gemfile | |
source "https://rubygems.org" | |
gem 'sinatra' | |
gem 'sinatra-authentication' | |
gem 'data_mapper' | |
gem 'dm-sqlite-adapter' | |
gem 'rdiscount' |
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'optparse' | |
require 'fileutils' | |
require 'open3' | |
TEMPLATE_URL = "https://github.com/Weltenbastler/template-mac.git" | |
# Print banner when arguments are missing | |
ARGV << '-h' if ARGV.count < 2 |
This file contains hidden or 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
// | |
// AppDelegate.swift | |
// TableZombies | |
// | |
// Created by Christian Tietze on 18/05/16. | |
// Copyright © 2016 Christian Tietze. All rights reserved. | |
// | |
import Cocoa |
This file contains hidden or 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
class ModalDialogController: NSWindowController { | |
convenience init() { | |
self.init(windowNibName: "ModalDialogController") | |
} | |
@IBOutlet var closeButton: NSButton! | |
override func windowDidLoad() { |
This file contains hidden or 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
// | |
// Based on: https://blog.beecomedigital.com/2015/06/27/developing-a-filesystemwatcher-for-os-x-by-using-fsevents-with-swift-2/ | |
// | |
import Foundation | |
public struct Event: CustomStringConvertible { | |
public let eventId: FSEventStreamEventId | |
public let eventPath: String |
This file contains hidden or 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
#!/usr/bin/env ruby | |
require 'optparse' | |
CURRENT_PATH = File.expand_path(File.dirname(__FILE__)) | |
FALLBACK_PATH = File.join(CURRENT_PATH, "..", "build-xcode", "Debug", "include", "libMultiMarkdown", "libMultiMarkdown.h") | |
options = {:mode => :nsenum} | |
OptionParser.new do |parser| | |
parser.banner = "Usage: #{$0} [options] path/to/libMultiMarkdown.h" |