With this extension, we can add the .if()
modifier to our View!
struct ContentView: View {
@State private var shouldAddShadow: Bool = true
<!DOCTYPE html> | |
<html lang="en" data-theme="dark"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>Mermaid preview</title> | |
<style> | |
.h-screen { | |
height: 100vh; | |
} |
/** | |
* inspired by: https://github.com/IonicaBizau/local-ip-address | |
* | |
* @returns localIPv4 address | |
*/ | |
function localIp4Address () { | |
const interfaces = Object.values(os.networkInterfaces()) | |
for (let iface of interfaces) { | |
for (let alias of iface) { | |
if (alias.family === "IPv4" |
GIST for embed in Enhance CLI with ZX article on Medium
struct DynamicFetchRequestView<T: NSManagedObject, Content: View>: View { | |
// That will store our fetch request, so that we can loop over it inside the body. | |
// However, we don’t create the fetch request here, because we still don’t know what we’re searching for. | |
// Instead, we’re going to create custom initializer(s) that accepts filtering information to set the fetchRequest property. | |
@FetchRequest var fetchRequest: FetchedResults<T> | |
// this is our content closure; we'll call this once the fetch results is available | |
let content: (FetchedResults<T>) -> Content |
// | |
// @ref https://www.swiftbysundell.com/articles/accessing-a-swift-property-wrappers-enclosing-instance/ | |
// @Ref https://stackoverflow.com/a/58406402/521197 | |
// | |
@propertyWrapper | |
struct NestedObservableObject<Value : ObservableObject> { | |
static subscript<T: ObservableObject>( | |
_enclosingInstance instance: T, | |
wrapped wrappedKeyPath: ReferenceWritableKeyPath<T, Value>, |
This is a PowerApp Component Custom Function JsonToTable(json As String) -> Table
that is able to transform a JSON Object in an equivalent PowerFx Table
Considering the JSON below as input
{
// | |
// App+Version.swift | |
// | |
// Created by bsorrentino on 29/12/2019. | |
// Copyright © 2019 Bartolomeo Sorrentino. All rights reserved. | |
// | |
import Foundation | |
# | |
# inspired by - https://github.com/rajyraman/pcf-template-dataset | |
# | |
name: pcf-init | |
on: | |
workflow_dispatch: | |
push: | |
branches: [master] | |
jobs: |
// Google Apps Script methods available to scripts | |
declare namespace google { | |
/** | |
* Methods available to Google Apps Script | |
*/ | |
namespace script { | |
interface IUrlLocation { | |
/** | |
* The string value of URL fragment after the # character, or an emptry string if no URL fragment is present |