This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
<each> tag for async fetch of a collection. | |
Just a toy playground for demo purposes of what I think would be a cool delcartive api to have, | |
so it misses a lot of important things (recursivity, for example) | |
Usage: | |
<each name="recipe" src="/data/recipes.json"> | |
<view | |
src="/views/card.html" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/php | |
<?php | |
// Remove any existing "content" directory and re-create it | |
system("rm -r content"); | |
system("mkdir -p content/images"); | |
$db = new SQLite3("database.sqlite"); | |
$result = $db->query("SELECT * FROM `ZSFNOTE` WHERE `ZTRASHED` LIKE '0'"); | |
$row = $result->fetchArray(); | |
$bear_img_dir = "Local Files/Note Images/"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Used in my BearKit Project: https://notas.cristian.lat | |
// Attribution not required, but highly appreciated 🙏 | |
class Tag { | |
constructor(name, slug, children) { | |
this.name = name | |
this.slug = slug | |
this.children = children | |
this.type = "tag" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
struct ContentView: View { | |
@State var isOn: Bool = false | |
var body: some View { | |
VStack(spacing: 24) { | |
Toggle("Native SwiftU/UIKit toggle", isOn: $isOn) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
fileprivate var store = createRamStore() | |
fileprivate var viewState = ViewState(store: store) | |
fileprivate var rootHandler = createCore(store: store) | |
@main | |
struct MyApp: App { | |
var body: some Scene { | |
WindowGroup { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
@main | |
struct MyApp: App { | |
var body: some Scene { | |
WindowGroup { | |
ContentView() | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Foundation | |
func main() { | |
let fileManager = FileManager.default | |
let path = fileManager.currentDirectoryPath | |
let url = URL(string: "file://" + path) | |
guard let enumerator = fileManager.enumerator(atPath: path) else { | |
fatalError("Directory doesn't exist") |