Skip to content

Instantly share code, notes, and snippets.

View Nikoloutsos's full-sized avatar

Konstantinos Nikoloutsos Nikoloutsos

  • Athens, Greece
View GitHub Profile
// swiftlint:disable file_length
fileprivate func compareOptionals<T>(lhs: T?, rhs: T?, compare: (_ lhs: T, _ rhs: T) -> Bool) -> Bool {
switch (lhs, rhs) {
case let (lValue?, rValue?):
return compare(lValue, rValue)
case (nil, nil):
return true
default:
return false
}
// sourcery: MyFirstSpell
protocol BoomProtocol {
func boom1()
func boom2()
func boom3(str: String, int: Int)
func boom4(args: String...)
}
@Nikoloutsos
Nikoloutsos / myAnimation.swift
Created December 25, 2021 20:40
Example fancygradient animation
import FancyGradient
...
func runAnimation() {
let myAnimation = CustomAnimation()
.then(ColorAnimation(newColors: [UIColor.red, UIColor.orange], duration: 3)) // color animation
.then(DirectionAnimation(newDirection: .up, duration: 2)) // then direction animation
fancyView.animate(animation: myAnimation) // Ask your fancyGradientView to play your sexy animation 🌈
}
name: ci
on:
push:
branches: [ master, 'develop' ]
pull_request:
branches: [ master, 'develop' ]
jobs:
build:
#!/bin/sh
# Used for adding some colors in the console. 🌈
# https://medium.com/@f3igao/get-started-with-git-hooks-5a489725c639
REDBOLD='\033[0;31;1m'
GREENBOLD='\033[0;32;1m'
NORMAL='\033[0m'
# The below input_file is file ".git/COMMIT_EDITMSG" where commits are stored
INPUT_FILE=$1
// sourcery: AutoMockable
protocol InboxDetailDisplayLogic: AnyObject {
func displayInitView(viewModel: InboxDetail.InitView.ViewModel)
func displayShowDetail(viewModel: InboxDetail.ShowDetail.ViewModel)
func displayOpenUrl(viewModel: InboxDetail.OpenURL.ViewModel)
}
@Nikoloutsos
Nikoloutsos / InboxDetailDisplayLogic.swift
Created May 8, 2022 11:42
Automockable protocol example
// sourcery: AutoMockable
protocol InboxDetailDisplayLogic: AnyObject {
func displayInitView(viewModel: InboxDetail.InitView.ViewModel)
func displayShowDetail(viewModel: InboxDetail.ShowDetail.ViewModel)
func displayOpenUrl(viewModel: InboxDetail.OpenURL.ViewModel)
}
@Nikoloutsos
Nikoloutsos / InboxDetailDisplayLogicSpy.swift
Created May 8, 2022 11:44
Automockable generated file
// Generated using Sourcery 1.8.1 — https://github.com/krzysztofzablocki/Sourcery
// DO NOT EDIT
// 💙💙 Autogenerated for saving Beegees time ⏰
// swiftlint:disable all
@testable import Blueground
final class InboxDetailDisplayLogicSpy: InboxDetailDisplayLogic {
// MARK: - displayInitView
var closureDisplayInitView: () -> () = {}
struct Human {
let firstName: String
let lastName: String
let fatherName: String
let motherName: String
let address: Location
let age: Int
}
func test_HumanAgeEligible {
// Given
let human = Human(
firstName: "John",
lastName: "Jow",
fatherName: "Nick",
motherName: "Maria",
address: .init(),
age: 14
)