Skip to content

Instantly share code, notes, and snippets.

View iSevenDays's full-sized avatar

Anton Sokolchenko iSevenDays

View GitHub Profile
@iSevenDays
iSevenDays / ViewModelClosable.swift
Last active October 12, 2021 10:40
SwiftUI create View Model that emits close action
import Foundation
import Combine
import SwiftUI
/// View Model closable protocol - conform to this protocol if your view model should emit close block to close the screen that uses this view model
public protocol ViewModelClosableProtocol {
var closeCancellable: AnyCancellable? { get set }
// when inheriting protocol, set @Published
// var shouldCloseView: Bool { get set }
@iSevenDays
iSevenDays / gist:4583750a17ee453783cbaa3acd4ab5fc
Created August 8, 2025 16:58
Qwen3-480b-A32b chat template for tool calling
{#- Copyright 2025-present Anton Sokolchenko. #}
{#- Licensed under the Apache License, Version 2.0 (the "License") #}
{#- Edits made by Anton Sokolchenko to fix the chat template #}
{% macro render_item_list(item_list, tag_name='required') %}
{%- if item_list is defined and item_list is iterable and item_list | length > 0 %}
{%- if tag_name %}{{- '\n<' ~ tag_name ~ '>' -}}{% endif %}
{{- '[' }}
{%- for item in item_list -%}
{%- if loop.index > 1 %}{{- ", "}}{% endif -%}
{%- if item is string -%}