Skip to content

Instantly share code, notes, and snippets.

View antingle's full-sized avatar
👨‍💻
Fixing Bugs

Anthony Ingle antingle

👨‍💻
Fixing Bugs
View GitHub Profile
@martinhoeller
martinhoeller / URL+Timestamp.swift
Created April 18, 2020 08:13
A URL extension to insert a timestamp in the URL's file name
extension URL {
// Inserts a timestamp into a URL's filename
// e.g. "/path/to/file.ext" -> "/path/to/file~1587197384.ext"
func addingTimestamp(separator: String = "~") -> URL {
let timestamp = Int(Date().timeIntervalSince1970)
let filename = deletingPathExtension().lastPathComponent + "\(separator)\(timestamp).\(pathExtension)"
return deletingLastPathComponent().appendingPathComponent(filename)
}
}
@unnamedd
unnamedd / MacEditorTextView.swift
Last active April 16, 2024 10:18
[SwiftUI] MacEditorTextView - A simple and small NSTextView wrapped by SwiftUI.
/**
* MacEditorTextView
* Copyright (c) Thiago Holanda 2020-2021
* https://twitter.com/tholanda
*
* MIT license
*/
import Combine
import SwiftUI
@bmhatfield
bmhatfield / .profile
Last active May 6, 2024 22:27
Automatic Git commit signing with GPG on OSX
# In order for gpg to find gpg-agent, gpg-agent must be running, and there must be an env
# variable pointing GPG to the gpg-agent socket. This little script, which must be sourced
# in your shell's init script (ie, .bash_profile, .zshrc, whatever), will either start
# gpg-agent or set up the GPG_AGENT_INFO variable if it's already running.
# Add the following to your shell init to set up gpg-agent automatically for every shell
if [ -f ~/.gnupg/.gpg-agent-info ] && [ -n "$(pgrep gpg-agent)" ]; then
source ~/.gnupg/.gpg-agent-info
export GPG_AGENT_INFO
else