Open ~/.bash_profile
in your favorite editor and add the following content to the bottom.
# Git branch in prompt.
parse_git_branch() {
/* | |
* Scaffolding | |
* Basic and global styles for generating a grid system, structural layout, and page templates | |
* ------------------------------------------------------------------------------------------- */ | |
.container | |
Sets a width of 940px which also centres the content (clears floated elements before/after) | |
.container-fluid | |
Sets a minimum width of 940px (clears floated elements before/after) |
One file for each domain, both www.example.com and example.com need separate files:
{
"applinks": {
"apps": [],
"details": {
"9JA89QQLNQ.com.apple.wwdc": {
/* | |
The "hello world" of neural networks: a simple 3-layer feed-forward | |
network that implements an XOR logic gate. | |
The first layer is the input layer. It has two neurons a and b, which | |
are the two inputs to the XOR gate. | |
The middle layer is the hidden layer. This has two neurons h1, h2 that | |
will learn what it means to be an XOR gate. | |
//: # Swift 3: JSON-serializable structs using protocols | |
//: Most of the implementation is based on the code in [this blog post](http://codelle.com/blog/2016/5/an-easy-way-to-convert-swift-structs-to-json/) | |
import Foundation | |
//: ### Defining the protocols | |
protocol JSONRepresentable { | |
var JSONRepresentation: Any { get } | |
} | |
protocol JSONSerializable: JSONRepresentable {} |
Following the tradition from last year, here's my complete list of all interesting features and updates I could find in Apple's OSes, SDKs and developer tools that were announced at this year's WWDC. This is based on the keynotes, the "What's New In ..." presentations and some others, Apple's release notes, and blog posts and tweets that I came across in the last few weeks.
If for some reason you haven't watched the talks yet, I really recommend watching at least the "State of the Union" and the "What's New In" intros for the platforms you're interested in. The unofficial WWDC Mac app is great way to download the videos and keep track of what you've already watched.
If you're interested, here are my WWDC 2015 notes (might be useful if you're planning to drop support for iOS 8 now and start using some iOS 9 APIs).
import UIKit | |
typealias Bough = (rotation:CGFloat, length: CGFloat, scale: CGFloat, hue: CGFloat) | |
final class TreeView : UIView { | |
private let limit = 10 | |
private let boughs : [Bough] = [ | |
(rotation: -25, length: 85, scale: 0.75, hue: 0.04), | |
(rotation: 30, length: 100, scale: 0.65, hue: 0.02) |
// | |
// GameViewController.h | |
// pulseeffectobjectivec | |
// | |
// Created by Lachlan Hurst on 10/3/17. | |
// Copyright © 2017 Lachlan Hurst. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> | |
#import <SceneKit/SceneKit.h> |
import Vision | |
//1 | |
let sourceImage = UIImage(named: "jony.jpg") | |
var resultImage = sourceImage | |
//2 | |
let detectFaceRequest = VNDetectFaceLandmarksRequest { (request, error) in | |
//4 | |
if let results = request.results as? [VNFaceObservation] { | |
//5 | |
for faceObservation in results { |