Skip to content

Instantly share code, notes, and snippets.

@aerobounce
aerobounce / scriptAppGenerator.py
Created July 28, 2022 18:22
Python script that generates a simple application that executes a script.
#!/usr/bin/env python3
from os import chmod, makedirs, stat, system
from stat import S_IXGRP, S_IXOTH, S_IXUSR
from sys import argv
# Application info
APP_NAME = "Test"
VERSION = "1.0.0"
BUNDLE_IDENTIFIER = f"io.github.aerobounce.{APP_NAME}"
@aerobounce
aerobounce / Behavior of CFBundleTypeIconSystemGenerated.md
Created February 6, 2022 06:53
Behavior of CFBundleTypeIconSystemGenerated in Info.plist

Behavior of CFBundleTypeIconSystemGenerated in Info.plist

CFBundleDocumentTypes:
  CFBundleTypeIconSystemGenerated: 1

Even if CFBundleTypeIconSystemGenerated in Info.plist is enabled, system will not generate icons using associated app if "CoreTypes" is already offering dedicated icons.

@aerobounce
aerobounce / open-icloudtabs.sh
Created October 23, 2021 18:49
convert iCloud tabs into html that lazily load its URL
#!/usr/bin/env bash
set -Ceu -o pipefail
TEMP_HTML_DIR="$(mktemp -d -t "open-icloudtabs")"
echo "Session directory:
$TEMP_HTML_DIR
"
DID_MAKE_WINDOW=0
makeWindowIfNeeded() {
@aerobounce
aerobounce / Fix Duplicated iCloud Tabs.md
Last active May 26, 2021 04:47
Fix Duplicated iCloud Tabs

Fix Duplicated iCloud Tabs

  1. Logout Apple ID on all the devices except the main device (or Delete them from your main device if unavailable to use)
  2. Make sure Logged in Device is only 1 device, the main device
  3. Do all the cleanup procedure if needed (such as Clearing Safari History)
  4. Check off Keychain
  5. Logout Apple ID on the main device
  6. Login to Apple ID on the main device
  7. Login on the other devices
  8. Done
import AppKit
import SwiftUI
// MARK: Wrap
public struct Wrap<Wrapped: NSView>: NSViewRepresentable {
private var makeView: () -> Wrapped
private var update: (Wrapped, Context) -> Void
public init(_ makeView: @escaping @autoclosure () -> Wrapped,
@aerobounce
aerobounce / macOS System Preference Pane Links.md
Last active August 23, 2024 20:54
macOS System Preference Pane Links
@aerobounce
aerobounce / karabiner.json
Last active January 25, 2022 17:16
Suppress MacBook Pro Key Repeat Faulty with Karabiner
{
"available_since": "12.6.9",
"description": "Surpress MacBook Pro Key Repeat Faulty",
"manipulators": [
{
"from": { "key_code": "b" },
"parameters": {
"basic.to_if_held_down_threshold_milliseconds": 25
},
"to_if_held_down": [{ "key_code": "b", "repeat": false }],
@aerobounce
aerobounce / unicode.sh
Created April 9, 2020 07:03
Retrive Unicode Character suitable to use with FontForge script
#!/usr/bin/env bash
set -Ceu
unicode() {
for i in "$@"; do
echo -n "$i" | # -n ignore trailing newline
iconv -f utf8 -t UTF-32BE | # UTF-32 big-endian happens to be the code point
xxd -p | # -p just give me the plain hex
sed -e 's/^0000/0u/' | # remove leading 0's, replace with 0x
sed -e 's/\n/ /' # remove leading 0's, replace with 0x
@aerobounce
aerobounce / asl.conf
Created April 8, 2020 09:42
configuration file for syslogd and aslmanager - Notice level log disabled for faster shell launching with Terminal.app
##
# configuration file for syslogd and aslmanager
##
# aslmanager logs
> /var/log/asl/Logs/aslmanager external style=lcl-b ttl=2
# authpriv messages are root/admin readable
? [= Facility authpriv] access 0 80
@aerobounce
aerobounce / FinderPaths.md
Last active April 9, 2020 07:07
How to get Finder's selection path in alias form, in AppleScript and JXA.

AppleScript

tell application "Finder"
    set itemList to (selection as alias list)
end tell

JXA

const Finder = Application("Finder")