Skip to content

Instantly share code, notes, and snippets.

@dinneo
dinneo / jenikns_ci_on_osx.md
Created January 18, 2017 16:48 — forked from ostinelli/jenkins_ci_on_osx.md
Setup Jenkins CI on OSX.

Jenkins CI on OSX

Instructions on how to setup a secured Jenkins CI on a Mac.

Download & Install dependencies

All of these operations are done with your admin user.

Developer tools

Install the command line developer tools.

@dinneo
dinneo / UIImagePickerControllerWithCircleOverlay.c
Created February 17, 2017 10:10 — forked from andreacipriani/UIImagePickerControllerWithCircleOverlay.c
iOS: UIImagePickerController editing view circle overlay
/**
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
@dinneo
dinneo / Country.swift
Created April 20, 2017 11:47 — forked from kharrison/Country.swift
Swift Hash Functions
import Foundation
struct Country {
let name: String
let capital: String
var visited: Bool
}
extension Country: Equatable {
static func == (lhs: Country, rhs: Country) -> Bool {
@dinneo
dinneo / How to download streaming video
Created May 4, 2017 09:10 — forked from danfinlay/How to download streaming video.md
How to download a streaming video with Google Chrome
#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
@dinneo
dinneo / RBResizer.swift
Created September 7, 2017 10:24 — forked from licvido/RBResizer.swift
SWIFT: Crop image to square (& resize)
//
// RBResizer.swift
// Locker
//
// Created by Hampton Catlin on 6/20/14.
// Copyright (c) 2014 rarebit. All rights reserved.
//
import UIKit
@dinneo
dinneo / resize-ui.swift
Created September 11, 2017 15:40 — forked from darcwader/resize-ui.swift
Resizing Image using 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
}
}
@dinneo
dinneo / notification.swift
Created October 13, 2017 15:52 — forked from ericdke/notification.swift
Deliver an OSX notification with Swift
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()
@dinneo
dinneo / Stopwatch.swift
Created November 17, 2017 07:16 — forked from kristopherjohnson/Stopwatch.swift
Swift classes for calculating elapsed time, similar to .NET's System.Diagnostics.Stopwatch class
// 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:
//
@dinneo
dinneo / PrecisionTimer.swift
Created November 17, 2017 13:00 — forked from kandelvijaya/PrecisionTimer.swift
Precision Timing in iOS/OSX/Swift
//: 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 }
@dinneo
dinneo / Clean_Architecture.md
Created June 29, 2018 14:55 — forked from y2468101216/Clean_Architecture.md
無瑕的程式碼 ─ 整潔的軟體設計與架構篇 心得

無瑕的程式碼 ─ 整潔的軟體設計與架構篇 心得

簡介

自己看天瓏簡介

你需要這本書嗎?

如果你還沒看過 clean code 我建議你先看 clean code ,但本書與 clean code 無相關,會這樣說純粹是 clean code 比較符合一般工程師的需求。 本書是給架構師看的,所以有許多抽象的地方。