Skip to content

Instantly share code, notes, and snippets.

@Shpigford
Shpigford / .cursorrules
Last active April 25, 2025 01:22
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.
@ixahmedxi
ixahmedxi / settings.json
Created January 2, 2024 08:05
My settings.json
{
"workbench.startupEditor": "none",
"workbench.iconTheme": "moxer-icons",
"workbench.colorTheme": "Aura Dark",
"workbench.settings.editor": "json",
"breadcrumbs.enabled": false,
"explorer.compactFolders": false,
"editor.wordWrap": "bounded",
"editor.tabSize": 2,
"editor.inlineSuggest.enabled": true,
@kamilogorek
kamilogorek / _screenshot.md
Last active May 29, 2025 21:24
Clutter-free VS Code Setup
image
@adibhanna
adibhanna / tmux.conf
Last active June 2, 2025 15:51
Tmux config
#--------------------------------------------------------------------------
# Configuration
#--------------------------------------------------------------------------
# Use Vi mode
setw -g mode-keys vi
# Increase scrollback buffer size
set -g history-limit 10000
@beader
beader / InfiniteScrollChart.swift
Last active August 28, 2024 18:16
Infinite Scrollable Bar Chart using Swift Charts
//
// InfiniteScrollChart.swift
// ChartsGallery
//
// Created by beader on 2022/11/3.
//
import SwiftUI
import Charts
@rplzzz
rplzzz / save-restore-pkgs.R
Created August 27, 2019 21:57
R functions for saving the list of installed packages and then reinstalling them all when you upgrade R
savepkgs <- function(saveloc)
{
instpkg <- installed.packages()
cranpkg <- available.packages()
iscran <- instpkg[,'Package'] %in% cranpkg[,'Package']
pkgdata <- data.frame(package=instpkg[,'Package'], iscran=iscran, instvers=instpkg[,'Version'])
write.csv(pkgdata, saveloc)
}
restore_pkgs <- function(pkglistfile)
@bewest
bewest / README.md
Created July 29, 2018 18:02
Getting one day data out of Nightscout

Get one day data out of Nightscout

Here's how to get one day of data out of Nightscout. The trick is in realizing that the field used to define the date is different between different data types, and that different data types are stored in different places. In addition, the API itself has interesting behaviors, for example to switch between tsv, csv, and json outputs, to perform regex based searches, and in some cases bugs to work around.

Mechanics of the search syntax. The API endpoints support a query string syntax used to compose queries.

Installing Nightscout on DigitalOcean Server

Why?

  • You have full SSH access to your server
  • Creating a server takes a minute
  • You can choose from various places on earth where the server should be located
  • You can make a backup / snapshot of the server in order to delete and later restore it (saves money if you don't need it for a while)
  • You pay per hour, the $5 / month version should be sufficient
  • Loads of documentation on how to install things
  • Control and track the server via the DigitalOcean control panel website
@phatblat
phatblat / AppDelegate.swift
Last active February 2, 2025 15:25
Example of creating HKObserverQuery and enabling background delivery for multiple HKObjectType
@UIApplicationMain
final class AppDelegate: UIResponder, UIApplicationDelegate {
let healthKitManager = HealthKitManager()
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool {
if onboardingComplete {
healthKitManager.requestAccessWithCompletion() { success, error in
if success { print("HealthKit access granted") }
else { print("Error requesting access to HealthKit: \(error)") }
}
@zacwest
zacwest / ios-font-sizes.swift
Last active May 8, 2025 21:46
iOS default font sizes - also available on https://www.iosfontsizes.com
let styles: [UIFont.TextStyle] = [
// iOS 17
.extraLargeTitle, .extraLargeTitle2,
// iOS 11
.largeTitle,
// iOS 9
.title1, .title2, .title3, .callout,
// iOS 7
.headline, .subheadline, .body, .footnote, .caption1, .caption2,
]