Skip to content

Instantly share code, notes, and snippets.

View seanlilmateus's full-sized avatar

Mateus seanlilmateus

View GitHub Profile
@seanlilmateus
seanlilmateus / 1.0 README.md
Created October 1, 2022 10:06 — forked from brettohland/1.0 README.md
ParseableFormatStyle Examples
@seanlilmateus
seanlilmateus / Stateful.swift
Created September 2, 2022 15:34 — forked from ole/Stateful.swift
A wrapper view that provides a mutable Binding to its content closure. Useful in Xcode Previews for interactive previews of views that take a Binding.
import SwiftUI
/// A wrapper view that provides a mutable Binding to its content closure.
///
/// Useful in Xcode Previews for interactive previews of views that take a Binding.
struct Stateful<Value, Content: View>: View {
var content: (Binding<Value>) -> Content
@State private var state: Value
init(initialState: Value, @ViewBuilder content: @escaping (Binding<Value>) -> Content) {
@seanlilmateus
seanlilmateus / ruby-redux.rb
Created July 21, 2022 20:17 — forked from eadz/ruby-redux.rb
Redux in Ruby
# Redux in Ruby
class Store
attr_reader :state
def initialize(initial_state, *reducers)
@reducers = reducers
@state = initial_state || {}
end
@seanlilmateus
seanlilmateus / ContentView.swift
Created June 24, 2022 01:54 — forked from awunnenb/ContentView.swift
SwiftUI WKWebView and Back- Forward Buttons
// Youtube Video: https://youtu.be/SBvrvJ93gh4
import SwiftUI
import WebKit
struct ContentView: View {
let webView = WebView(request: URLRequest(url: URL(string: "https://www.google.com")!))
var body: some View {
VStack {
@seanlilmateus
seanlilmateus / Caddyfile
Created June 6, 2022 09:57 — forked from Finkregh/Caddyfile
nextcloud php-fpm caddy 2
(headers) {
header {
-Server
Strict-Transport-Security "max-age=31536000; includeSubDomains; preload"
X-XSS-Protection "1; mode=block"
X-Permitted-Cross-Domain-Policies "none"
X-Content-Type-Options "nosniff"
X-Frame-Options "SAMEORIGIN"
X-Robots-Tag "nine"
Permissions-Policy interest-cohort=()
//
// CircularProgressView.swift
// SwiftUI30WWDC2021
//
// Created by Mateo on 5/6/22.
//
// dependency: https://gist.github.com/mattyoung/5f5c0f13c06d980e823481e0334c00fe
import Combine
extension URLSession {
/// Returns a publisher that wraps a URL session download task for a given
/// URL.
///
/// - Parameter url: The URL for which to create a download task.
/// - Returns: A publisher that wraps a download task for the URL.
@seanlilmateus
seanlilmateus / version.bash
Created February 13, 2022 19:07 — forked from pyrtsa/version.bash
Xcode: Set version and build number from Git
#!/bin/bash
# Xcode: Set version and build number from Git
# --------------------------------------------
#
# This script sets the version number `CFBundleShortVersionString` to one of
#
# - `1.2.3` -- for the tagged commit `v1.2.3` or a hyphen-separated prerelease,
# e.g. `v1.2.3-alpha`, `v1.2.3-alpha.2`, `v1.2.3-beta`, `v1.2.3-rc`.
# - `1.2.3-7-gabc1234` -- at commit `abc1234`, 7 commits after `v1.2.3`,
# - `1.2.3-7-gabc1234-dirty` -- when there are uncommitted changes, or
@seanlilmateus
seanlilmateus / FormDemoApp.swift
Created February 8, 2022 18:12 — forked from marcprux/FormDemoApp.swift
Example of aligning labels in SwiftUI.Form on macOS
//
// FormDemoApp.swift
// FormDemo
//
// Created by Marc Prud'hommeaux
//
import SwiftUI
@main