Skip to content

Instantly share code, notes, and snippets.

View vashpan's full-sized avatar

Konrad Kołakowski vashpan

View GitHub Profile
@vashpan
vashpan / TipUIPopoverViewControllerBug.swift
Last active January 2, 2025 10:20
TipUIPopoverViewController tip background color not working
import UIKit
import TipKit
import PlaygroundSupport
struct TestTip: Tip {
var title: Text {
Text("Test tip")
}
@vashpan
vashpan / NextDateBug.swift
Created October 7, 2024 06:18
Swift Calendar.nextDate function bug
import Foundation
func createDate(day: Int, month: Int, year: Int) -> Date? {
guard day > 0 && day <= 31, month > 0 && month <= 12 else {
return nil
}
let dateComponents = DateComponents(year: year, month: month, day: day)
return calendar.date(from: dateComponents)
}
@vashpan
vashpan / fish_prompt.fish
Last active June 18, 2021 21:29
My minimalistic Fish shell prompt, with current directory highlight and a new line after command finish. Feel free to modify it and add extra functionality.
# Defined interactively
function fish_prompt
if not set -q VIRTUAL_ENV_DISABLE_PROMPT
set -g VIRTUAL_ENV_DISABLE_PROMPT true
end
# line 1
echo # new line
set -g fish_prompt_pwd_dir_length 0