Skip to content

Instantly share code, notes, and snippets.

View morajabi's full-sized avatar

Mo morajabi

View GitHub Profile
@jlia0
jlia0 / agent loop
Last active April 20, 2025 03:43
Manus tools and prompts
You are Manus, an AI agent created by the Manus team.
You excel at the following tasks:
1. Information gathering, fact-checking, and documentation
2. Data processing, analysis, and visualization
3. Writing multi-chapter articles and in-depth research reports
4. Creating websites, applications, and tools
5. Using programming to solve various problems beyond development
6. Various tasks that can be accomplished using computers and the internet
@morajabi
morajabi / FPSCounter.swift
Created December 29, 2024 19:16
An FPS Counter for macOS apps built for inline.chat
import AppKit
import Charts
import CoreVideo
import SwiftUI
struct FPSMeasurement: Identifiable, Equatable {
let id: Int
let fps: Int
static func == (lhs: FPSMeasurement, rhs: FPSMeasurement) -> Bool {
@dena-sohrabi
dena-sohrabi / AppDatabase.swift
Created October 16, 2024 12:27
Encrypted Database (GRDB + SQLCipher)
import Foundation
import GRDB
// MARK: - DB main class
public final class AppDatabase: Sendable {
public let dbWriter: any DatabaseWriter
public init(_ dbWriter: any GRDB.DatabaseWriter) throws {
self.dbWriter = dbWriter
@morajabi
morajabi / FormState.swift
Last active October 16, 2024 12:28
Form state management in Swift UI
import SwiftUI
struct FormStateData {
var loading: Bool
var error: String?
var succeeded: Bool?
}
// A helper for easier state management for simple forms
class FormState: ObservableObject {
@Shpigford
Shpigford / .cursorrules
Last active April 1, 2025 08:09
Cursor Rules
# Original instructions: https://forum.cursor.com/t/share-your-rules-for-ai/2377/3
# Original original instructions: https://x.com/NickADobos/status/1814596357879177592
You are an expert AI programming assistant that primarily focuses on producing clear, readable SwiftUI code.
You always use the latest version of SwiftUI and Swift, and you are familiar with the latest features and best practices.
You carefully provide accurate, factual, thoughtful answers, and excel at reasoning.
- Follow the user’s requirements carefully & to the letter.
@charrondev
charrondev / tauri_traffic_light_positioner_plugin.rs
Last active December 26, 2024 16:06
This code describes a mechanism to adjust traffic light positioning on MacOS with Tauri 2.x
use objc::{msg_send, sel, sel_impl};
use rand::{distributions::Alphanumeric, Rng};
use tauri::{
plugin::{Builder, TauriPlugin},
Manager, Runtime, Window,
}; // 0.8
const WINDOW_CONTROL_PAD_X: f64 = 15.0;
const WINDOW_CONTROL_PAD_Y: f64 = 23.0;
class TimeElapsed: CustomStringConvertible {
private let startTime: CFAbsoluteTime
private var endTime: CFAbsoluteTime?
init() {
startTime = CFAbsoluteTimeGetCurrent()
}
var description: String {
time
@bdsqqq
bdsqqq / vesper-dark.json
Last active December 1, 2024 20:38
Vesper theme for zed.dev
{
"$schema": "https://zed.dev/schema/themes/v0.1.0.json",
"name": "Vesper",
"author": "Rauno Freiberg",
"themes": [
{
"name": "Vesper",
"appearance": "dark",
"style": {
"border": "#101010",
@msanford1540
msanford1540 / MultiPartFormData.swift
Last active January 28, 2025 10:10
Swift 5/6 Multipart form-data Support
//
// MultiPartFormData.swift
//
import Foundation
/* Example Call site: */
func upload(imageData: Data) async throws {
guard let url = URL(string: "https://example.com/upload") else { return }
var multipartFormData = MultipartFormData()
@hoishing
hoishing / HowTo.md
Last active March 4, 2025 11:14
VSCode keybindings for Xcode

VSCode keybindings for Xcode

  • copy VSCode.idekeybindings to ~/Library/Developer/Xcode/UserData/KeyBindings
  • in Xcode preferences -> key bindings, select VSCode