Skip to content

Instantly share code, notes, and snippets.

View eneko's full-sized avatar
💻

Eneko Alonso eneko

💻
View GitHub Profile
@eneko
eneko / swiftui_public_interface.swift
Created November 10, 2023 16:35
SwiftUI public interface - Xcode 15.0 15A240d
This file has been truncated, but you can view the full file.
import Accessibility
import AppKit
import Combine
import CoreData
import CoreFoundation
import CoreGraphics
import CoreText
import CoreTransferable
import Darwin
@eneko
eneko / create_dmg.sh
Last active March 12, 2023 15:51
Create DMG image from folder
#
# <filename>.dmg can be a path to a file on an existing folder
# <window title> appears when the DMG is open
# <file system> APFS, HFS+, etc
# UDRW format makes the image read/write (use UDSP for read-only)
#
hdiutil create <filename>.dmg -volname "<window title>" -fs APFS -format UDRW -srcfolder <path/to/folder>
@eneko
eneko / main.swift
Created October 26, 2022 15:13
Swift 5.7 compiler hang
public indirect enum Expression {
case term(Bool)
case list(_ expressions: [Expression])
public func contains(where predicate: (Bool) -> Bool) -> Bool {
switch self {
case let .term(term):
return predicate(term)
case let .list(expressions):
return expressions.contains { expression in
@eneko
eneko / words.spanish.json
Created January 8, 2022 17:30
List of Spanish words from wspanish 1.0.29 source package in Ubuntu Raw (JSON array)
This file has been truncated, but you can view the full file.
[
"a",
"aarónica",
"aarónico",
"ab",
"abab",
"ababillarse",
"ababol",
"abacá",
@eneko
eneko / words.spanish.utf8
Created January 8, 2022 17:07
List of Spanish words from wspanish 1.0.29 source package in Ubuntu
a
aarónica
aarónico
ab
abab
ababillarse
ababol
abacá
abacera
abacería
@eneko
eneko / wordle2.json
Created January 7, 2022 22:15
List of World words (second collection) sorted alphabetically
[
"aahed",
"aalii",
"aargh",
"aarti",
"abaca",
"abaci",
"abacs",
"abaft",
"abaka",
@eneko
eneko / wordle1.json
Created January 7, 2022 22:15
List of World words (first collection) sorted alphabetically
[
"aback",
"abase",
"abate",
"abbey",
"abbot",
"abhor",
"abide",
"abled",
"abode",
@eneko
eneko / LRUCacheActor.swift
Last active October 7, 2022 11:54
Thread-safe, ordered-dictionary-backed, actor-based LRU cache
//
// LRUCacheActor.swift
// LRUCacheActor
//
// Created by Eneko Alonso on 9/5/21.
//
import Foundation
import OrderedCollections
function xcodeclean
echo "Cleaning Xcode Derived Data folder..."
command rm -frd ~/Library/Developer/Xcode/DerivedData/*
echo "Cleaning Xcode caches folder..."
command rm -frd ~/Library/Caches/com.apple.dt.Xcode/*
end
function ll
command ls -lashG $argv
end