Skip to content

Instantly share code, notes, and snippets.

@tunaitis
tunaitis / cleanup.sh
Created December 8, 2024 20:20
A bash script to clean up all app data for testing macOS app's first launch experience
#!/bin/bash
# Configuration
APP_ID="com.your.app-id"
APP_NAME="YourAppName"
echo "🧹 Cleaning ${APP_NAME} data..."
# Clear preferences
defaults delete ${APP_ID} 2>/dev/null || true
@tunaitis
tunaitis / backup.sh
Created December 3, 2024 19:20
SQLite database rolling backup script with rclone
#!/bin/bash
DB_PATH="/path/to/sqlite/database.db" # Path to your SQLite database
TIMESTAMP=$(date +"%Y%m%d_%H%M%S") # Timestamp for the backup
ROLLING_LIMIT=30 # Number of backups to keep
BACKUP_DIR="/tmp" # Temporary local backup directory
BACKUP_NAME="backup_$TIMESTAMP.sqlite" # Backup filename
REMOTE_NAME="remote" # Name of your rclone remote
REMOTE_PATH="backups" # Remote bucket or folder
@realvjy
realvjy / ChoasLinesShader.metal
Last active December 8, 2025 22:02
Choas Lines - Metal Shader
// Lines
float hash( float n ) {
return fract(sin(n)*753.5453123);
}
// Slight modification of iq's noise function.
float noise(vector_float2 x )
{
vector_float2 p = floor(x);
vector_float2 f = fract(x);
@dkun7944
dkun7944 / CDView.swift
Last active September 28, 2025 06:34
SwiftUI + Swift.Shader CD
//
// CDView.swift
// CD
//
// Created by Daniel Kuntz on 7/3/23.
//
import SwiftUI
struct ShapeWithHole: Shape {
@antingle
antingle / CustomMacTextView.swift
Last active April 14, 2025 01:02 — forked from unnamedd/MacEditorTextView.swift
CustomMacTextView - A simple NSScrollView wrapped by SwiftUI with placeholder text
//
// CustomMacTextView.swift
//
// MacEditorv2 Created by Marc Maset - 2021
// Changes inspired from MacEditorTextView by Thiago Holanda
//
// Modified by Anthony Ingle - 2022
//
import SwiftUI
@aronbalog
aronbalog / ScrollViewWrapper.swift
Created March 17, 2020 10:57
UIScrollView Wrapper for SwiftUI
import SwiftUI
public struct ScrollViewWrapper<Content: View>: UIViewRepresentable {
@Binding var contentOffset: CGPoint
let content: () -> Content
public init(contentOffset: Binding<CGPoint>, @ViewBuilder _ content: @escaping () -> Content) {
self._contentOffset = contentOffset
self.content = content
}
@jfuellert
jfuellert / ScrollableView.swift
Last active April 24, 2025 01:55
A scrollable SwiftUI view, UIScrollView wrapper. ScrollableView lets you read and write content offsets for scrollview in SwiftUI, with and without animations.
import SwiftUI
struct ScrollableView<Content: View>: UIViewControllerRepresentable, Equatable {
// MARK: - Coordinator
final class Coordinator: NSObject, UIScrollViewDelegate {
// MARK: - Properties
private let scrollView: UIScrollView
var offset: Binding<CGPoint>
@unnamedd
unnamedd / MacEditorTextView.swift
Last active December 26, 2025 02:58
[SwiftUI] MacEditorTextView - A simple and small NSTextView wrapped by SwiftUI.
/**
* MacEditorTextView
* Copyright (c) Thiago Holanda 2020-2025
* https://bsky.app/profile/tholanda.com
*
* (the twitter account is now deleted, please, do not try to reach me there)
* https://twitter.com/tholanda
*
* MIT license
@timothycosta
timothycosta / UIScrollViewWrapper.swift
Created July 5, 2019 03:25
UIScrollView wrapped for SwiftUI
//
// UIScrollViewWrapper.swift
// lingq-5
//
// Created by Timothy Costa on 2019/07/05.
// Copyright © 2019 timothycosta.com. All rights reserved.
//
import SwiftUI
@CMCDragonkai
CMCDragonkai / regular_expression_engine_comparison.md
Last active November 21, 2025 01:30
Regular Expression Engine Comparison Chart

Regular Expression Engine Comparison Chart

Many different applications claim to support regular expressions. But what does that even mean?

Well there are lots of different regular expression engines, and they all have different feature sets and different time-space efficiencies.

The information here is just copied from: http://regular-expressions.mobi/refflavors.html