Skip to content

Instantly share code, notes, and snippets.

View jamesktan's full-sized avatar
🎯
Focusing

James Tan jamesktan

🎯
Focusing
View GitHub Profile
@berkcebi
berkcebi / progress-indicator-spinning-color.swift
Created August 23, 2018 00:45
Changing the color of a spinning `NSProgressIndicator` using Core Image filters.
extension NSProgressIndicator {
func set(tintColor: NSColor) {
guard let adjustedTintColor = tintColor.usingColorSpace(.deviceRGB) else {
contentFilters = []
return
}
let tintColorRedComponent = adjustedTintColor.redComponent
@kunikullaya
kunikullaya / Date+Extension.swift
Created January 18, 2017 05:21
Date Extension for Swift
import Foundation
extension Date {
func toString(format: String = "yyyy-MM-dd") -> String {
let formatter = DateFormatter()
formatter.dateStyle = .short
formatter.dateFormat = format
return formatter.string(from: self)
}