Skip to content

Instantly share code, notes, and snippets.

View LinusSkucas's full-sized avatar

Linus Skucas LinusSkucas

View GitHub Profile
sudo /usr/libexec/PlistBuddy -c "Add 'GelatoCore:Enabled' bool false" /Library/Preferences/FeatureFlags/Domain/Messages.plist
sudo /usr/libexec/PlistBuddy -c "Add 'Gelato:Enabled' bool false" /Library/Preferences/FeatureFlags/Domain/Sharing.plist
To restore defaults:
sudo /usr/libexec/PlistBuddy -c "delete 'GelatoCore:Enabled'" /Library/Preferences/FeatureFlags/Domain/Messages.plist
sudo /usr/libexec/PlistBuddy -c "delete 'Gelato:Enabled'" /Library/Preferences/FeatureFlags/Domain/Sharing.plist
Reboot your machine after these changes.
@dkun7944
dkun7944 / ContentView.swift
Created July 31, 2023 03:36
AirDrop iOS 17 Swift.Shader Animation
//
// ContentView.swift
// Airdrop Demo
//
// Created by Daniel Kuntz on 7/30/23.
//
import SwiftUI
struct ContentView: View {
@TheSunCat
TheSunCat / DisblockOrigin.theme.css
Last active June 12, 2024 22:39
Hide all Nitro & Boost upsells in Discord!
/**
* @name Adblock for Discord
* @author TheSunCat and contributors
* @version 1.0.0
* @description Hide all Nitro & Boost upsells on Discord!
* @source https://gist.github.com/TheSunCat/58fedaa19d6154ef3e4b2b676c286906
*/
/* ------------------ */
/* Hide Nitro upsells */
@drewkerr
drewkerr / get-focus-mode.js
Last active May 29, 2024 16:16
Read the current Focus mode on macOS Monterey (12.0+) using JavaScript for Automation (JXA)
const app = Application.currentApplication()
app.includeStandardAdditions = true
function getJSON(path) {
const fullPath = path.replace(/^~/, app.pathTo('home folder'))
const contents = app.read(fullPath)
return JSON.parse(contents)
}
function run() {
@username0x0a
username0x0a / Safari15StableBackFwdButtons.m
Created October 2, 2021 18:01
Safari 15 Stable Back & Forward buttons in the single-line Unified tab bar
#import <Cocoa/Cocoa.h>
#import <objc/runtime.h>
@interface Injector: NSView @end
@implementation Injector
+ (void)load {
@zhuowei
zhuowei / safariinject.m
Last active October 22, 2021 17:15
Restores old tab bar in Safari 15.0 (16612.1.29.41.4, 16612)
// Restores old tab bar in Safari 15.0 (16612.1.29.41.4, 16612)
// clang -fmodules -shared -Wall -Os -o libsafariinject.dylib safariinject.m
//
// If SIP off:
// DYLD_INSERT_LIBRARIES=$PWD/libsafariinject.dylib /Applications/Safari.app/Contents/MacOS/Safari
//
// If SIP on, you can demo this by manually removing Safari's code signing signature, but many
// features (eg saved logins) won't be readable by the resigned app:
// cp -a /Applications/Safari.app ./
// codesign --remove Safari.app/Contents/MacOS/Safari
@samwarnick
samwarnick / migrate.swift
Last active January 25, 2023 16:11
Migrate to app group
// In my core data stack
let container = NSPersistentCloudKitContainer(name: "DataModel")
let storeUrl = FileManager.default.containerURL(forSecurityApplicationGroupIdentifier: groupIdentifier)!.appendingPathComponent("DataModel.sqlite")
// Enable history tracking and remote notifications
guard let description = container.persistentStoreDescriptions.first else {
fatalError("###\(#function): Failed to retrieve a persistent store description.")
}
description.setOption(true as NSNumber, forKey: NSPersistentHistoryTrackingKey)
description.setOption(true as NSNumber, forKey: NSPersistentStoreRemoteChangeNotificationPostOptionKey)
@jordansinger
jordansinger / Settings.swift
Created February 20, 2021 18:30
iOS 6 Settings built in SwiftUI
//
// Settings.swift
// Settings
//
// Created by Jordan Singer on 2/20/21.
//
import SwiftUI
struct Settings: View {
## Where to find info and how to report on system extensions in macOS Catalina+
# Staged system extensions location in folder based on unique ID
/Library/SystemExtensions/
# Info on each
/Library/SystemExtensions/db.plist
Includes...
- state (enabled, activated, etc.)
- associated launchd plists