Skip to content

Instantly share code, notes, and snippets.

View RhetTbull's full-sized avatar

Rhet Turnbull RhetTbull

View GitHub Profile
@simonw
simonw / macos-machine-learning-models.md
Created May 21, 2020 15:46
Machine learning models installed on macOS is part of Vision.framework

Machine learning models installed on macOS is part of Vision.framework

I found these while poking around at the list of open files for photoanalysisd in Activity Monitor.

% ls -lahS /System/Library/Frameworks/Vision.framework/Versions/A/Resources
total 465616
-rw-r--r--    1 root  wheel    40M Dec 13 16:32 landmarks_v2.bin
-rw-r--r--    1 root  wheel    31M Dec 13 16:32 scenenet_sc2.4_sa1.4_ae1.4_r9_opt_int8.espresso.weights
-rw-r--r--    1 root  wheel    29M Dec 13 16:32 scenenet_sc2.4_sa1.4_ae1.6_r13.4_opt_int8_asymetric.espresso.weights
@aslakr
aslakr / apple-photo-schema.sql
Last active May 4, 2020 11:41
sqlite ".schema" dump
CREATE TABLE ZADDITIONALASSETATTRIBUTES (
Z_PK INTEGER PRIMARY KEY, Z_ENT INTEGER,
Z_OPT INTEGER, ZALLOWEDFORANALYSIS INTEGER,
ZCAMERACAPTUREDEVICE INTEGER, ZCLOUDAVALANCHEPICKTYPE INTEGER,
ZCLOUDGROUPINGSTATE INTEGER, ZCLOUDKINDSUBTYPE INTEGER,
ZCLOUDRECOVERYSTATE INTEGER, ZCLOUDSTATERECOVERYATTEMPTSCOUNT INTEGER,
ZDESTINATIONASSETCOPYSTATE INTEGER,
ZEMBEDDEDTHUMBNAILHEIGHT INTEGER,
ZEMBEDDEDTHUMBNAILLENGTH INTEGER,
ZEMBEDDEDTHUMBNAILOFFSET INTEGER,
@0xced
0xced / Working without a nib.md
Created March 7, 2019 19:02
Working without a nib blog posts by Jeff Johnson (@lapcatsoftware)
  • [Working without a nib, Part 1][1]
  • [Working without a nib, Part 2: Also Also Wik][2]
  • [Working without a nib, Part 5: No, 3!][3]
  • [Working without a nib, Part 4: setAppleMenu][4]
  • [Working without a nib, Part 5: Open Recent menu][5]
  • [Working without a nib, Part 6: Working without a xib][6]
  • [Working without a nib, Part 7: The empire strikes back][7]
  • [Working without a nib, Part 8: The nib awakens][8]
  • [Working without a nib, Part 9: Shipping without a nib][9]
  • [Working without a nib, Part 10: Mac Main Menu][10]
@xthezealot
xthezealot / README.md
Last active March 4, 2025 19:55
Normalize unicode file names (converts UTF-8 NFD to NFC). Required by macOS clients through AFP/NFS/SMB. Tested on Synology DSM 6.2 with built-in Python 2.7.12.

NFCFN.py

Normalize unicode file names (converts UTF-8 NFD to NFC).
Required by macOS clients through AFP/NFS/SMB.

Tested on Synology DSM 6.2 with built-in Python 2.7.12.

Usage

@rene-d
rene-d / get_gists.py
Last active December 11, 2024 08:56 — forked from leoloobeek/get_gists.py
Download all gists for a specific user
#! /usr/bin/env python3
import requests
import sys
from subprocess import call
import yaml
import os
import json
import argparse
@aprilmintacpineda
aprilmintacpineda / Using Multiple SSH keys - Beginner Friendly.md
Last active February 24, 2026 06:43
Beginner Friendly: Using Multiple SSH keys

How to follow this guide

The problem

I have one computer and two different github accounts. One is for work, the other is for my personal stuff. I can't use the same ssh key twice, so I have to use different ssh key for each of my accounts. How do I do that? How do I switch between these ssh keys?

@BuildWithLal
BuildWithLal / python-singleton.py
Last active September 28, 2020 20:10
Create a singleton class using Python 3
class Singleton(object):
def __new__(cls):
if not hasattr(cls, 'instance') or not cls.instance:
cls.instance = super().__new__(cls)
return cls.instance
obj1 = Singleton()
obj2 = Singleton()
@User001501
User001501 / multithreaded_sqlite.py
Last active February 5, 2024 13:59 — forked from consindo/multithreaded_sqlite.py
Multithreaded SQLite Python
from threading import Thread
from multiprocessing import Queue
import sqlite3, sys, time, datetime
class MultiThreadOK(Thread):
def __init__(self, db):
super(MultiThreadOK, self).__init__()
self.db=db
self.reqs=Queue()
self.start()
@dreness
dreness / LSFileInfo example
Last active October 17, 2022 17:51
Interrogate LaunchServices using #PyObjC to query file paths for default app handler, all possible app handlers, and the UTI
xomg% python LSFileInfo.py dylib-map.sqlite
('\n', u'/Users/andre/bin/dylib-map.sqlite')
('UTI: ', u'dyn.ah62d4rv4ge81g6pqrf4gn')
('default app: ', file:///Applications/DB%20Browser%20for%20SQLite.app/)
('all apps: ', (
"file:///Applications/DB%20Browser%20for%20SQLite.app/"
))
@mcxiaoke
mcxiaoke / EXIFImage-playground.swift
Created July 6, 2017 09:24 — forked from kwylez/EXIFImage-playground.swift
Modifying EXIF Data with Swift 3
//: Playground - noun: a place where people can play
import UIKit
import ImageIO
import MobileCoreServices
let TEST_IMAGE: String = "replace.jpg"
let beach: UIImage = UIImage(named: TEST_IMAGE)!
let imageData: Data = UIImageJPEGRepresentation(beach, 1)!