Skip to content

Instantly share code, notes, and snippets.

View Fiser12's full-sized avatar
🎯
Focusing

Rubén García Fiser12

🎯
Focusing
View GitHub Profile
{
"id":"8eea6dec-73d9-4790-b4cd-e1abdd67d658",
"title":"Our next event",
"description":"My event description,here you can set a default text for the event to define the main ideas",
"image":"https://i.ibb.co/7Cdw0SP/Generic-Meeting-image-1.png",
"content":{
"globalQuestionary":{
"rootNode":{
"type":"single",
"current":{
blueprint:
name: Zigbee2MQTT - WXKG02LM_rev2 2 button remote
description: Automate your WXKG02LM_rev2 using Zigbee2MQTT events.
domain: automation
input:
mqtt_topic:
name: MQTT Topic
description: The MQTT topic to subscribe to for button presses
default: 'zigbee2mqtt/[ESTUDIO] Escritorio Botón/action'
selector:
blueprint:
name: Zigbee2MQTT - Tuya TS0043 3 button remote
description: Automate your Tuya TS0043 3 button remote using Zigbee2MQTT events.
domain: automation
input:
mqtt_topic:
name: MQTT Topic
description: The MQTT topic to subscribe to for button presses
default: 'zigbee2mqtt/[ESTUDIO] Boton Persiana/action'
selector:
@Fiser12
Fiser12 / fuctional-programing-contramap-es.md
Created February 7, 2024 20:48
Swift y programación funcional: Contramap

Swift y programación funcional: Contramap

La programación funcional ha introducido varios conceptos poderosos que pueden mejorar significativamente la claridad, concisión y expresividad del código. Entre estos, los predicados y la función contramap ofrecen una manera elegante de construir lógica de validación y filtrado reutilizable y componible. En este artículo, exploraremos cómo estos conceptos pueden aplicarse en Swift para resolver problemas complejos de manera eficiente. Predicados y contramap: Una Introducción

Un Predicate<A> es una estructura que encapsula una condición que los elementos de tipo A deben cumplir. Esta condición se representa mediante un closure que toma un elemento de tipo A y devuelve un valor booleano, indicando si el elemento cumple o no con la condición especificada. La función contramap, por otro lado, permite transformar un Predicate<b> en un Predicate<a> , dada una función que convierte de A a B. Esto es particularmente útil cuando queremos aplicar un predi

@Fiser12
Fiser12 / semantic-commit-messages.md
Last active January 24, 2024 10:20 — forked from joshbuchea/semantic-commit-messages.md
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@Fiser12
Fiser12 / AVLTree.swift
Created April 11, 2023 23:10
AVLTree in swift for store data in a efficient way
final class AVLTree<Element: Comparable> {
private var value: Element?
private var left: AVLTree<Element>?
private var right: AVLTree<Element>?
private var balanceFactor: Int8 = 0
private var height: Int
init() {
height = (value == nil) ? 0 : 1
//
// main.swift
// Philosofers problem with actors (monitors)
//
//
import Foundation
let TiempoDeComer: UInt64 = 2_000_000_000
let TiempoDePensar: UInt64 = 1_000_000_000
@Fiser12
Fiser12 / README.md
Created March 10, 2023 21:59 — forked from IsaacXen/README.md
(Almost) Every WWDC videos download links for aria2c.
@propertyWrapper
public struct AnyProxy<EnclosingSelf, Value> {
private let keyPath: ReferenceWritableKeyPath<EnclosingSelf, Value>
public init(_ keyPath: ReferenceWritableKeyPath<EnclosingSelf, Value>) {
self.keyPath = keyPath
}
@available(*, unavailable, message: "The wrapped value must be accessed from the enclosing instance property.")
public var wrappedValue: Value {
@Fiser12
Fiser12 / KeychainWrapper.swift
Last active February 21, 2023 17:19
I have created a simplified version of KeychainAccess that allows you to just mark a property of a class like @KeychainWrapper("tag"), to store it under a tag as long as it implements Codable. This makes it very easy to make use of the Keychain.
// I got inspiration in this repository https://github.com/kishikawakatsumi/KeychainAccess
// This is a great library that is backward compatible with very old versions of iOS and macOS and gives you a very complete wrapper of the Keychain
// But it was too much for me, since I didn't need neither that backward compatibility nor so many features, I just wanted to keep Codable secrets in the Keychain.
// So I have made my own version, also implementing a Property Wrapper to make it agnostic to use.
// I have thus reduced the 3000 lines of KeychainAccess to less than 200 and I have made its use for the functions I was interested in much more agile and integrated with SwiftUI,
// KeychainWrapper.swift
// SyncTion (macOS)
//
// Created by Rubén on 20/2/23.
//