Skip to content

Instantly share code, notes, and snippets.

components:
schemas:
EventMotive:
additionalProperties: false
properties:
eventType:
$ref: '#/components/schemas/MotivesCategory'
id:
format: int32
type: integer
swagger: '2.0'
info:
description: "description"
version: 1.0.0
title: OpenAPI
tags:
- name: person
description: persons
paths:
/person:
swagger: '2.0'
info:
description: "description"
version: 1.0.0
title: OpenAPI
tags:
- name: person
description: persons
paths:
/person:
@propertyWrapper
open class PropertyWrapperWithOpenInit {
var _value: String
open init(wrappedValue: String) { // error: only classes and overridable class members can be declared 'open'; use 'public'
self._value = wrappedValue
}
open var wrappedValue: String {
get {
return _value
}
@4brunu
4brunu / AutoCodableObjc.stencil
Created February 15, 2021 12:48
Sourcery template for Codable on Objc classes
{% for type in types.all where type.based.AutoCodableObjc or type|annotated:"AutoCodableObjc" %}
// sourcery:inline:auto:{{ type.name }}.AutoCodableObjc
enum CodingKeys: String, CodingKey {
{% for variable in type.allVariables where variable.isComputed == false %}case {{variable.name}}
{% endfor %}
}
{{type.accessLevel}} required init(from decoder: Decoder) throws {
let container = try decoder.container(keyedBy: CodingKeys.self)
{% for variable in type.allVariables where variable.isComputed == false %}{{variable.name}} = try{% if variable.isOptional %}?{% endif %} container.decode({{variable.typeName}}.self, forKey: .{{variable.name}})
@4brunu
4brunu / AutoDelegateWrapper.stencil
Created February 17, 2021 15:00
Sourcery template for wrapping delegates with closures
import Foundation
{% macro swiftifyMethodName name %}{{ name | replace:"(","_" | replace:")","" | replace:":","_" | replace:"`","" | snakeToCamelCase | lowerFirstWord }}{% endmacro %}
{% for protocol in types.protocols where protocol.based.AutoDelegateWrapper or protocol|annotated:"AutoDelegateWrapper" %}
{% if type.name != "AutoDelegateWrapper" %}
class {{ protocol.name }}Wrapper: {{ protocol.name }} {
#! /usr/bin/env bash
while [[ $# -gt 1 ]]
do
key="$1"
case $key in
-p|--prefix)
IFS=';' read -ra PREFIX <<< "$2"
shift # past argument
#! /usr/bin/env bash
# IOS.cmake
# Architectures: i386 armv7 armv7s x86_64 arm64
# declare -a ABIs=("SIMULATOR" "OS")
# declare -a ABIs=("SIMULATOR")
# declare -a ABIs=("OS")
# declare -a BUILD_TYPES=("Debug" "Release")
@4brunu
4brunu / buildlogs-os_log_t.txt
Created April 7, 2021 13:47
Xamarin binding build logs for os_log_t
Building MyiOSLib (Debug|iPhoneSimulator)
Build started 4/7/2021 2:46:02 PM.
Environment at start of build:
MONO_DEBUG = disable_omit_fp
LANGUAGE = en
__CFBundleIdentifier = com.microsoft.visual-studio
DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR = /usr/local/share/dotnet
PATH = /Library/Frameworks/Mono.framework/Commands:/Applications/Visual Studio.app/Contents/Resources:/Applications/Visual Studio.app/Contents/MacOS:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:~/.dotnet/tools:/usr/local/share/dotnet
LOGNAME = user
@4brunu
4brunu / buildlogs-OSLog.txt
Created April 7, 2021 13:49
Xamarin binding build logs for OSLog
Building MyiOSLib (Debug|iPhoneSimulator)
Build started 4/7/2021 2:49:01 PM.
Environment at start of build:
MONO_DEBUG = disable_omit_fp
LANGUAGE = en
__CFBundleIdentifier = com.microsoft.visual-studio
DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR = /usr/local/share/dotnet
PATH = /Library/Frameworks/Mono.framework/Commands:/Applications/Visual Studio.app/Contents/Resources:/Applications/Visual Studio.app/Contents/MacOS:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:~/.dotnet/tools:/usr/local/share/dotnet
LOGNAME = user