Skip to content

Instantly share code, notes, and snippets.

View RuiNelson's full-sized avatar

Rui Nelson RuiNelson

  • Porto, Portugal
View GitHub Profile
@RuiNelson
RuiNelson / README.md
Last active October 20, 2025 13:10
How to Use GLM Coding Plan and Claude Pro/Max Simultaneously with Claude Code on macOS

Who is this script for?

For those who have a Claude (Anthropic) account and a GLM Coding Plan (Z.ai) account and want to use Claude Code for both.

What does this script solve?

On macOS, Claude Code stores access credentials in the Keychain (macOS Keychain is a secure database that the operating system provides to applications for storing secrets). This makes the setup more secure but less programmatically configurable.

How does this script solve this problem?

@RuiNelson
RuiNelson / Overscrolling_Form.swift
Created July 11, 2025 16:19
How to add overscroll to a Form or a ScrollView in SwiftUI. Here’s the right modifier to achieve the desired effect.
Form {
Text("Form content")
}
.contentMargins(.bottom, 1234.56)
import UIKit
import SwiftUI
class ViewController: UIViewController {
var hosting: UIHostingController<SwiftUIView>?
override func viewDidLoad() {
@RuiNelson
RuiNelson / FileManager+isDirectory.swift
Created August 22, 2018 18:01
Check if path is a directory in Swift 4.x
import Foundation
extension FileManager {
func isDirectory(atPath: String) -> Bool {
var check: ObjCBool = false
if fileExists(atPath: atPath, isDirectory: &check) {
return check.boolValue
} else {
return false
}
@RuiNelson
RuiNelson / Levenshtein.swift
Last active August 2, 2023 03:50
Levenshtein distance between two String for Swift 4.x
import Foundation
extension String {
subscript(index: Int) -> Character {
return self[self.index(self.startIndex, offsetBy: index)]
}
}
extension String {
public func levenshtein(_ other: String) -> Int {