Skip to content

Instantly share code, notes, and snippets.

View seanlilmateus's full-sized avatar

Mateus seanlilmateus

View GitHub Profile
@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
@seanlilmateus
seanlilmateus / aosp_meminfo_commands
Created January 27, 2022 07:07 — forked from chris-piekarski/aosp_meminfo_commands
AOSP Memory/Content Related ADB Commands/Call Logs
adb shell dumpsys procstats --hours 3
adb shell dumpsys meminfo
adb shell dumpsys activity
#get com.android content providers
adb shell dumpsys | grep Provider{ | grep com.android
#call logs
adb shell content query --uri content://call_log/calls
@seanlilmateus
seanlilmateus / AdbCommands
Created January 24, 2022 09:06 — forked from ernestkamara/AdbCommands
Adb useful commands list
== Adb Server
adb kill-server
adb start-server
== Adb Reboot
adb reboot
adb reboot recovery
adb reboot-bootloader
== Shell
@seanlilmateus
seanlilmateus / ManagedObjectChangesPublisher.swift
Created January 23, 2022 16:37 — forked from mjm/ManagedObjectChangesPublisher.swift
Observe changes to a Core Data fetch request with Combine
import Combine
import CoreData
extension NSManagedObjectContext {
func changesPublisher<Object: NSManagedObject>(for fetchRequest: NSFetchRequest<Object>)
-> ManagedObjectChangesPublisher<Object>
{
ManagedObjectChangesPublisher(fetchRequest: fetchRequest, context: self)
}
}