Add the following to your ~/.bashrc
:
alias g='git'
Add the following to your ~/.zshrc
:
function notifyme {
LAST_EXIT_CODE=$?
CMD=$(fc -ln -1)
osascript -e 'on run argv
tell application "System Events"
set frontApp to name of first application process whose frontmost is true
if frontApp is not "Terminal" then
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
package bayes | |
// Classifier implements the Naive Bayes Classifier. | |
type Classifier struct { | |
classPerWordCount map[string]int | |
classPerDocument map[string]int | |
wordClassCount map[string]map[string]int | |
documentsCount int | |
} |
class Board { | |
fileprivate let kSize = 9 // number of rows and columns | |
fileprivate var squares: [Square] | |
fileprivate var units: [[[Int]]] = [] | |
fileprivate var peers: [[Int]] = [] | |
init(_ string: String) { | |
squares = [Square](repeating: Square(0b111111111), count: kSize * kSize) | |
for index in 0..<(kSize * kSize) { |
class Board: CustomStringConvertible { | |
var values: [Int] | |
let kSize = 9 // number of rows and columns | |
init(_ string: String) { | |
values = string.characters.map { Int(String($0)) ?? 0 } | |
} | |
var empty: Int? { | |
return values.index(of: 0) |
<?xml version="1.0" encoding="UTF-8"?> | |
<Bucket | |
type = "2" | |
version = "2.0"> | |
<Breakpoints> | |
<BreakpointProxy | |
BreakpointExtensionID = "Xcode.Breakpoint.ExceptionBreakpoint"> | |
<BreakpointContent | |
shouldBeEnabled = "Yes" | |
ignoreCount = "0" |
public class Throttler { | |
private let queue: DispatchQueue = DispatchQueue.global(qos: .background) | |
private var job: DispatchWorkItem = DispatchWorkItem(block: {}) | |
private var previousRun: Date = Date.distantPast | |
private var maxInterval: TimeInterval | |
public init(maxInterval: TimeInterval) { | |
self.maxInterval = maxInterval |
// | |
// Copyright © 2018 wojteklu. All rights reserved. | |
// | |
#import <UIKit/UIKit.h> | |
@interface SaliencyDetector: NSObject | |
-(CGRect)findMostProminentPartOfImage:(UIImage *)image; | |
-(UIImage *)selectMostProminentPartOfImage:(UIImage *)image; |
// Run any SwiftUI view as a Mac app. | |
import Cocoa | |
import SwiftUI | |
NSApplication.shared.run { | |
VStack { | |
Text("Hello, World") | |
.padding() | |
.background(Capsule().fill(Color.blue)) |