Here is the looks and feel of your terminal once the tutorial has been applied on your system:
Using Homebrew:
// | |
// NSNull+LCFMessageForwarding.h | |
// NSNull | |
// | |
// Created by leichunfeng on 15/12/22. | |
// Copyright © 2015年 leichunfeng. All rights reserved. | |
// | |
#import <Foundation/Foundation.h> |
import Foundation | |
typealias CancelableTask = (cancel: Bool) -> Void | |
func delay(time: NSTimeInterval, work: dispatch_block_t) -> CancelableTask? { | |
var finalTask: CancelableTask? | |
var cancelableTask: CancelableTask = { cancel in | |
if cancel { |
extension String { | |
init<T>(dumping x: T) { | |
self.init() | |
dump(x, to: &self) | |
} | |
} | |
func assertDumpsEqual<T>(_ lhs: @autoclosure () -> T, _ rhs: @autoclosure () -> T, file: StaticString = #file, line: UInt = #line) { | |
assert(String(dumping: lhs()) == String(dumping: rhs()), "Expected dumps to be equal.", file: file, line: line) | |
} |
#!/bin/bash | |
# update_build_number.sh | |
# Usage: `update_build_number.sh [branch]` | |
# Run this script after the 'Copy Bundle Resources' build phase | |
# Ref: http://tgoode.com/2014/06/05/sensible-way-increment-bundle-version-cfbundleversion-xcode/ | |
branch=${1:-'master'} | |
buildNumber=$(expr $(git rev-list $branch --count) - $(git rev-list HEAD..$branch --count)) | |
echo "Updating build number to $buildNumber using branch '$branch'." |
#!/bin/bash | |
# Link: <https://gist.github.com/jellybeansoup/db7b24fb4c7ed44030f4> | |
# | |
# A command-line script for incrementing build numbers for all known targets in an Xcode project. | |
# | |
# This script has two main goals: firstly, to ensure that all the targets in a project have the | |
# same CFBundleVersion and CFBundleShortVersionString values. This is because mismatched values | |
# can cause a warning when submitting to the App Store. Secondly, to ensure that the build number | |
# is incremented appropriately when git has changes. | |
# |
// | |
// main.swift | |
// mutablecomposition | |
// | |
// Created by Kevin Meaney on 24/08/2015. | |
// Copyright (c) 2015 Kevin Meaney. All rights reserved. | |
// | |
import Foundation |
# Tips from: http://xcodehelp.blogspot.ie/2012/05/add-version-number-to-settings-screen.html | |
# Reference from: https://developer.apple.com/library/mac/documentation/DeveloperTools/Reference/XcodeBuildSettingRef/1-Build_Setting_Reference/build_setting_ref.html | |
# Get the correct path for the git binary | |
git=`sh /etc/profile; which git` | |
# Save paths for the project and target Info.plist | |
projectPlistPath="${PROJECT_DIR}/${INFOPLIST_FILE}" | |
targetPlistPath="${TARGET_BUILD_DIR}/${INFOPLIST_PATH}" |
/* | |
** Copyright (c) 2012, Romain Dura romain@shazbits.com | |
** | |
** Permission to use, copy, modify, and/or distribute this software for any | |
** purpose with or without fee is hereby granted, provided that the above | |
** copyright notice and this permission notice appear in all copies. | |
** | |
** THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES | |
** WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF | |
** MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY |
extension String { | |
func size(withAttributes attrs: [String:AnyObject], constrainedTo box: NSSize) -> NSRect { | |
let storage = NSTextStorage(string: self) | |
let container = NSTextContainer(containerSize: NSSize(width: box.width, height: box.height)) | |
let layout = NSLayoutManager() | |
layout.addTextContainer(container) | |
storage.addLayoutManager(layout) | |
storage.addAttributes(attrs, range: NSMakeRange(0, storage.length)) | |
container.lineFragmentPadding = 0.0 | |
let _ = layout.glyphRangeForTextContainer(container) |
Here is the looks and feel of your terminal once the tutorial has been applied on your system:
Using Homebrew: