Instructions on how to setup a secured Jenkins CI on a Mac.
All of these operations are done with your admin user.
Install the command line developer tools.
/** | |
Credit: I've started by reading this SO question: http://stackoverflow.com/questions/20794187/uiimagepickercontroller-editing-view-circle-overlay-edited | |
Trick to add a circle view on image picker editing to facilitate circular cropping | |
Tested on iPhone4s, iPhone5, iPhone6, iPhone6+, iPad - iOS 7 and iOS 8 - on May 2015 | |
**/ | |
#pragma mark - UINavigationControllerDelegate | |
- (void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated |
import Foundation | |
struct Country { | |
let name: String | |
let capital: String | |
var visited: Bool | |
} | |
extension Country: Equatable { | |
static func == (lhs: Country, rhs: Country) -> Bool { |
#How to download streaming video | |
Streaming just means a download that they don't want you to keep. But Chrome's developer tools make it easy to access what's really going on under the hood. | |
##Open Developer Tools | |
From the page where you want to download some things, go into your chrome menu to open the developer tools. You can either: | |
1. (On a mac): Command-option-J | |
2. (On a PC): Control-alt-J |
// | |
// RBResizer.swift | |
// Locker | |
// | |
// Created by Hampton Catlin on 6/20/14. | |
// Copyright (c) 2014 rarebit. All rights reserved. | |
// | |
import UIKit |
extension UIImage { | |
func resizeUI(size:CGSize) -> UIImage? { | |
UIGraphicsBeginImageContextWithOptions(size, true, self.scale) | |
self.drawInRect(CGRect(origin: CGPointZero, size: size)) | |
let resizedImage = UIGraphicsGetImageFromCurrentImageContext() | |
UIGraphicsEndImageContext() | |
return resizedImage | |
} | |
} |
func showNotification() -> Void { | |
var notification = NSUserNotification() | |
notification.title = "Test from Swift" | |
notification.informativeText = "The body of this Swift notification" | |
notification.soundName = NSUserNotificationDefaultSoundName | |
NSUserNotificationCenter.defaultUserNotificationCenter().deliverNotification(notification) | |
} | |
//showNotification() |
// Copyright (c) 2017 Kristopher Johnson | |
// | |
// Permission is hereby granted, free of charge, to any person obtaining a | |
// copy of this software and associated documentation files (the | |
// "Software"), to deal in the Software without restriction, including | |
// without limitation the rights to use, copy, modify, merge, publish, | |
// distribute, sublicense, and/or sell copies of the Software, and to | |
// permit persons to whom the Software is furnished to do so, subject to | |
// the following conditions: | |
// |
//: Playground - noun: a place where code can play | |
import UIKit | |
//Most precise time keeper | |
// for more information on the benchmarks go to www.kandelvijaya.com | |
func timeBlockWithMach(_ block: () -> Void) -> TimeInterval { | |
var info = mach_timebase_info() | |
guard mach_timebase_info(&info) == KERN_SUCCESS else { return -1 } |
自己看天瓏簡介
如果你還沒看過 clean code 我建議你先看 clean code ,但本書與 clean code 無相關,會這樣說純粹是 clean code 比較符合一般工程師的需求。 本書是給架構師看的,所以有許多抽象的地方。