Skip to content

Instantly share code, notes, and snippets.

class FloatingPanel: NSPanel {
init(contentRect: NSRect, backing: NSWindow.BackingStoreType, defer flag: Bool) {
// Not sure if .titled does affect anything here. Kept it because I think it might help with accessibility but I did not test that.
super.init(contentRect: contentRect, styleMask: [.nonactivatingPanel, .resizable, .closable, .fullSizeContentView], backing: backing, defer: flag)
// Set this if you want the panel to remember its size/position
// self.setFrameAutosaveName("a unique name")
// Allow the pannel to be on top of almost all other windows
@fhefh2015
fhefh2015 / CustomDashedView.swift
Created June 24, 2021 02:03
CustomDashedView
//
// DashedBorderView.swift
// AInOne
//
// Created by Apple on 2021/6/23.
//
import UIKit
class DashedBorderView: UIView {
@meddokss
meddokss / Styled-components-error.md
Last active January 13, 2025 18:13
[Styled-components Error] Warning: React does not recognize the prop on a DOM element. #STYLED
Warning: React does not recognize the `isEditing` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `isediting` instead. If you accidentally passed it from a parent component, remove it from the DOM element.
    in button (created by ForwardRef(Tab))
    in ForwardRef(Tab) (created by Context.Consumer)
    in StyledComponent (created by Styled(Component))
    in Styled(Component) (at App.js:14)

In the TextBox component you're passing all the props from the parent via {...props}. Considering that TextField itself doesn't have 'isEditing' property, I assume it passes it down to the underlying input DOM element, which doesn't recognise that prop.

@phanatagama
phanatagama / Quizizz.com Auto Answer
Last active May 9, 2025 13:27
Completed Quiziz Test Bot
if (window.location.href.search("quizizz.com/join/game/") == -1 && window.location.href.search("gameType=") == -1) {
if (window.location.href.search("quizizz.com/join/pre-game/") != -1) {
alert("You cannot execute this while paused. If you are not paused please DM phanatagama_ on instagram")
throw new Error("You cannot execute this while paused. If you think this is an error please DM phanatagama_ on instagram!");
} else if (window.location.href.search("quizizz.com/join/quiz/") != -1) {
alert("You need to start the game before running this script. If you think this is an error please DM phanatagama_ on instagram")
throw new Error("You need to start the game before running this script. If you think this is an error please DM phanatagama_ on instagram");
} else {
alert("You aren't on a quizizz quiz. If you think this is an error please DM phanatagama_ on instagram")
throw new Error("You aren't on a quizizz quiz. If you think this is an error please DM
@cupnoodle
cupnoodle / toggleSync.md
Last active November 13, 2023 15:11
Disable sync of NSPersistentCloudKitContainer at launch, then enable sync later

To disable iCloud sync of core data when the app launches, set the cloudKitContainerOptions to nil for the persistent store.

In your AppDelegate.swift file :

lazy var persistentContainer: NSPersistentCloudKitContainer = {

        let container = NSPersistentCloudKitContainer(name: "your core data container name")
        
        guard let description = container.persistentStoreDescriptions.first else {
            fatalError("###\(#function): Failed to retrieve a persistent store description.")
@aerobounce
aerobounce / macOS System Preference Pane Links.md
Last active October 22, 2025 10:59
macOS System Preference Pane Links
@rmcdongit
rmcdongit / macOS_SytemPrefs.md
Last active October 22, 2025 18:09
Apple System Preferences URL Schemes

macOS 10.15 System Preference Panes

Below are a list of System Preference pane URLs and paths that can be accessed with scripting to assist users with enabling macOS security settings without having to walk them through launching System Preferences, finding panes, and scrolling to settings. Not all panes have an accessible anchor and some are OS specific.

To find the Pane ID of a specific pane, open the System Preferences app and select the desired Preference Pane. With the pane selected, open the ScriptEditor.app and run the following script to copy the current Pane ID to your clipboard and display any available anchors:

tell application "System Preferences"
	set CurrentPane to the id of the current pane
	set the clipboard to CurrentPane
@a1ip
a1ip / hostname.md
Last active April 24, 2025 13:33
How to set the Mac hostname or computer name from the terminal

How to set the Mac hostname or computer name from the terminal

  1. Open a terminal.
  2. Type the following command to change the primary hostname of your Mac: This is your fully qualified hostname, for example myMac.domain.com
sudo scutil --set HostName <new host name>
  1. Type the following command to change the Bonjour hostname of your Mac: This is the name usable on the local network, for example myMac.local.