Skip to content

Instantly share code, notes, and snippets.

View kylebrowning's full-sized avatar
📱
slanging code.

Kyle Browning kylebrowning

📱
slanging code.
View GitHub Profile

Syncing between encrypted Git Repositories

Sometimes you want to keep folders in sync across different computers with some kind of file versioning, maybe you also want some kind of backup. You could use a private repository on GitHub, Bitbucket or Gitlab for that. However, when that data is particularly private, you might want to encrypt your data. git-remote-gcrypt can do that for you. As other guides on that topic were not very specific about syncing between two different computers, this guide focuses on that.

Other Sources

These are the sources I used:

@mbrandonw
mbrandonw / FB10144005.md
Last active March 22, 2024 17:05
iOS 16 Navigation API feedbacks

How to execute logic when NavigationLink is tapped?

FB10144005

Currently it doesn't seem possible to execute additional logic when a navigation link is tapped with the new NavigationLink(value:) initializer. When the link is tapped it updates path state all the way back at the root NavigationStack to drive navigation, but there are many times where we need to perform logic after the tap and before the drill down.

For example, after tapping a link we may want to pre-emptively load some data to show on the drill down screen. Or we may want to perform some form validation. Or we may want to track some analytics. This does not seem possible with the current link API.

A workaround is to use Buttons instead of NavigationLinks, but then you lose all of the styling and affordances given to links, such as chevrons when used in List.

If the API for NavigationLink cannot be changed to accomodate for this, perhaps a new ButtonStyle could be introduced that allows regular buttons to take on the sty

@StarLard
StarLard / DetentSheet.swift
Last active January 7, 2023 07:22
A simple implementation of an UISheetPresentationController wrapper using SwiftUI
//
// DetentSheet.swift
// StarLardKit
//
// Created by Caleb Friden on 9/28/21.
//
import SwiftUI
// MARK: - Public
@prafullakumar
prafullakumar / ScrollableTab.swift
Created February 7, 2021 07:09
Demo : ScrollableTab using swiftUI
import SwiftUI
struct ContentView: View {
@State private var selection = 1 //selected page
let dataModel = ["Forums", "Learn", "Careers", "Store", "About"]
var body: some View {
NavigationView {
VStack {
//ScrollableTabView
ScrollView(.horizontal, showsIndicators: false, content: {
@0xTim
0xTim / deploy.swift
Last active December 19, 2022 13:13
A Swift script to deploy an app (in this case Vapor) to AWS Fargate from scratch. It first checks to see if there's a repository in ECR for the app, if not it creates one, builds the container and pushes it. It then checks for a registered task definition. In one doesn't exist in ECS, it updates the provided task definition with the latest ECR i…
#!/usr/bin/swift
import Foundation
// MARK: - Script variables
let awsProfileName: String? = "myProfile"
let serviceName = "someService"
// MARK: - Functions
@discardableResult
func shell(_ args: String..., returnStdOut: Bool = false, stdIn: Pipe? = nil) -> (Int32, Pipe) {
@pkuecuekyan
pkuecuekyan / WKWebViewSizeToFit.swift
Last active March 12, 2024 11:37
Adjust height of WKWebView frame based on scrollHeight of the webView's content
// Since the WKWebView has no sizeToFit() method, increase the frame height of the webView to
// match the height of the content's scrollHeight
//
// The WKWebView's `navigationDelegate` property needs to be set for the delegate method to be called
func webView(_ webView: WKWebView, didFinish navigation: WKNavigation!) {
if webView.isLoading == false {
webView.evaluateJavaScript("document.body.scrollHeight", completionHandler: { [weak self] (result, error) in
if let height = result as? CGFloat {
@FokkeZB
FokkeZB / README.md
Created September 20, 2013 09:38
URL schemes for iOS and Android (2/2)
@webchick
webchick / drupal-hooks-by-implementation
Last active April 9, 2020 10:00
A list of hooks in all* Drupal contrib modules (6.x and 7.x), in descending order of how often they're implemented. (Consolidated a few that were renamed between 6 and 7) * Within a rounding error. :P
Array
(
[hook_menu] => 6744
[hook_uninstall] => 4742
[hook_perm(ission)] => 4012
[hook_install] => 3751
[hook_theme] => 3525
[hook_schema] => 3003
[hook_help] => 2465
[hook_form_alter] => 2273