Skip to content

Instantly share code, notes, and snippets.

Force RGB Color on M1 Mac

How to Force RGB Color Output instead of YPbPr on your M1 Apple Silicon Mac for an External Monitor.

This step-by-step video tutorial will guide you through the procedure of forcing RGB color output on your M1 Mac.

Force RGB Color on M1 Mac

Here is the direct link to the video tutorial: https://www.youtube.com/watch?v=Z1EqH3fd0V4

The video also has Closed Captions (Subtitles) that you can enable, to make it easier to follow if needed.

Force RGB Color on M1 Mac

How to Force RGB Color Output instead of YPbPr on your M1 Apple Silicon Mac for an External Monitor.

This step-by-step video tutorial will guide you through the procedure of forcing RGB color output on your M1 Mac.

Force RGB Color on M1 Mac

Here is the direct link to the video tutorial: https://www.youtube.com/watch?v=Z1EqH3fd0V4

The video also has Closed Captions (Subtitles) that you can enable, to make it easier to follow if needed.

@krackers
krackers / patch-edid.md
Created August 8, 2024 22:05 — forked from ejdyksen/patch-edid.md
A script to fix EDID problems on external monitors in macOS

patch-edid.rb

A script to fix EDID problems on external monitors in macOS.

Instructions

  1. Connect only the problem display.

  2. Create this directory structure (if it doesn't already exist):

@krackers
krackers / NSString.m
Created April 5, 2024 18:51 — forked from 0xced/NSString.m
Reverse-engineered implementation of -[NSString isEqual:] and -[NSString isEqualToString:]
/*
* Most NSString instances will actually be __NSCFString instances, so here are both NSString and __NSCFString implementations.
* If you know how to create an NSString instance whose class is actually NSString please let me know.
* Other possible concrete subclasses of NSString are: NSConstantString, __NSCFConstantString, NSPathStore2, NSSimpleCString and __NSLocalizedString.
*/
// CoreFoundation.framework 635.19.0 (Mac OS X 10.7.3)
@implementation NSObject
- (BOOL) isNSString__
@krackers
krackers / CVPixelFormat Descriptions
Created November 6, 2023 07:17 — forked from gregcotten/CVPixelFormat Descriptions
All Public and Private CVPixelFormat Descriptions
Structure is [PixelFormatTitle: DescriptionDictionary]. PixelFormatTitle is the kCVPixelFormatType_ suffix (if known) and the FourCharCode as a string or int if the string is too short.
[["32ARGB / 32": {
BitsPerBlock = 32;
BitsPerComponent = 8;
BlackBlock = <ff000000>;
CGBitmapContextCompatibility = 1;
CGBitmapInfo = 16388;
CGImageCompatibility = 1;
ContainsAlpha = 1;
@krackers
krackers / DefaultKeyBinding.dict
Created November 5, 2023 04:10 — forked from zsimic/DefaultKeyBinding.dict
OSX key bindings
{
/* ~/Library/KeyBindings/DefaultKeyBinding.dict
See https://gist.github.com/zsimic/1367779, prefix cheatsheet:
Char Short Key
$ S- Shift ⇧
^ C- CTRL ⌃
~ O- Option ⌥ (⊞ Win key position on PC)
@ M- Command ⌘ (Alt position on PC)
# Numeric Keypad
@krackers
krackers / Makefile
Created September 19, 2023 04:51 — forked from kazupon/Makefile
semaphore multi process sample for Mac OSX
CC=gcc
all: multi-process-counter
build: multi-process-counter
multi-process-counter:
${CC} -std=c99 -o multi-process-counter multi-process-counter.c
#${CC} -std=c99 -arch x86_64 -o multi-process-counter multi-process-counter.c
@krackers
krackers / mach_semaphore.c
Created September 19, 2023 04:51 — forked from kazupon/mach_semaphore.c
Using mach_semaphore on Mac OS X to mutually signaling between two threads. This could be extended to work with different processes.
//
// Created by Yogesh Swami on 2/24/12.
// Copyright (c) 2012 __MyCompanyName__. All rights reserved.
//
//
// clang -Wall -Wextra -Wall -o mach_semaphore mach_semaphore.c
//
// using mach semaphore for mutually signalling between two threads.
@krackers
krackers / gist:2b85ef0d6fab32ab0aaac1bd3aa38907
Created September 3, 2023 09:10 — forked from andrewsardone/gist:3751168
How does UIKit get pixels onto the screen?

UIView Drawing Model

-[UIView setNeedsDisplay]

You have some kind of custom UIView which implements some awesome drawing in -[UIView drawRect:]. In order to have UIKit draw it for you, you send the -[UIView setNeedsDisplay] to the view object to queue it up for drawing.

-[CALayer setNeedsDisplay]

     *------------*           *------------*

| | | |

@krackers
krackers / python_stream.md
Created August 25, 2023 09:22 — forked from hzhu212/python_stream.md
Python iterator with chain-call like Java stream

Python Stream object act like Java Stream, features include lazy calculating, slicing, chain-call etc.

stream.py:

import functools
import itertools


class Stream(object):