create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
create different ssh key according the article Mac Set-Up Git
$ ssh-keygen -t rsa -C "[email protected]"
// Create CustomView.xib, set File's Owner to CustomView. | |
// Link the top level view in the XIB to the contentView outlet. | |
class CustomView : UIView { | |
@IBOutlet private var contentView:UIView? | |
// other outlets | |
override init(frame: CGRect) { // for using CustomView in code | |
super.init(frame: frame) | |
self.commonInit() |
// | |
// ConcurrentOperation.swift | |
// | |
// Created by Caleb Davenport on 7/7/14. | |
// | |
// Learn more at http://blog.calebd.me/swift-concurrent-operations | |
// | |
import Foundation |
/* | |
MKAnnotationView has one init listed in its documentation, initWithAnnotation:reuseIdentifier:, so let's override that. | |
But this causes a runtime exception: | |
fatal error: use of unimplemented initializer 'init(frame:)' for class 'PulsatingDotMarker' | |
*/ | |
class PulsatingDotMarker: MKAnnotationView { | |
let innerCircle: UIView |
// | |
// NSString+Distance.h | |
// | |
// Created by Alexander Johansson on 2011-11-27. | |
// Based on http://stackoverflow.com/q/5684973/590396 | |
// | |
#import <Foundation/Foundation.h> | |
@interface NSString (Distance) |
func timeAgoSinceDate(date:NSDate, numericDates:Bool) -> String { | |
let calendar = NSCalendar.currentCalendar() | |
let unitFlags = NSCalendarUnit.CalendarUnitMinute | NSCalendarUnit.CalendarUnitHour | NSCalendarUnit.CalendarUnitDay | NSCalendarUnit.CalendarUnitWeekOfYear | NSCalendarUnit.CalendarUnitMonth | NSCalendarUnit.CalendarUnitYear | NSCalendarUnit.CalendarUnitSecond | |
let now = NSDate() | |
let earliest = now.earlierDate(date) | |
let latest = (earliest == now) ? date : now | |
let components:NSDateComponents = calendar.components(unitFlags, fromDate: earliest, toDate: latest, options: nil) | |
if (components.year >= 2) { | |
return "\(components.year) years ago" |
//Group 4 will be executed last after 1-3 are done executing | |
//Multi Threadin in Swift Group Dispatch Example | |
//Global Dispatch Queue | |
let dispatchGroup = dispatch_group_create() | |
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0), { | |
// | |
// TCHorizontalSelectorView.m | |
// TwinCodersLibrary | |
// | |
// Created by Guillermo Gutiérrez on 16/01/13. | |
// Copyright (c) 2013 TwinCoders S.L. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> |
- (void)viewDidLoad { | |
//find the UITextField view within searchBar (outlet to UISearchBar) | |
//and assign self as delegate | |
for (UIView *view in searchBar.subviews){ | |
if ([view isKindOfClass: [UITextField class]]) { | |
UITextField *tf = (UITextField *)view; | |
tf.delegate = self; | |
break; | |
} | |
} |