Skip to content

Instantly share code, notes, and snippets.

//
// coredock.h
// Header file for undocumented Dock SPI
//
// Arranged by Wolfgang Baird
// Based on CoreDockPrivate.h from http://www.cocoadev.com/index.pl?DockPrefsPrivate
//
// Contributors:
// Alacatia Labs: Initial version posted at http://www.cocoadev.com/index.pl?DockPrefsPrivate
// Tony Arnold: CoreDockGetWorkspacesEnabled, CoreDockSetWorkspacesEnabled, CoreDockSetWorkspacesCount
@gerasimsergey
gerasimsergey / gist:fe5082f396eae152dfd1cd094b1a02c4
Created February 5, 2021 11:14 — forked from sdsykes/gist:5c2c0c2a41396aead3b7
Windows on a space (using private CGS)
/// header
id CGSCopyManagedDisplaySpaces(int conn);
int _CGSDefaultConnection();
id CGSCopyWindowsWithOptionsAndTags(int conn, unsigned owner, NSArray *spids, unsigned options, unsigned long long *setTags, unsigned long long *clearTags);
// code
int spaceNumber = 0; // the space you want to get the windows for. numbering starts at 0.
NSVisualEffectMaterial constants, and the undocumented materials they coorespond to in various modes:
+----------------------+-------+----------+------+---------+
| MATERIAL # | LIGHT | LIGHT EM | DARK | DARK EM |
+----------------------+-------+----------+------+---------+
| | | | | |
| 0 - Appearance Based | 3 | 3 | 5 | 5 |
| | | | | |
| 1 - Light | 3 | 3 | 3 | 3 |
| | | | | |
| 2 - Dark | 4 | 4 | 4 | 4 |
@gerasimsergey
gerasimsergey / gist:7dee3607ca7e833cea92735a0ce80c5b
Created April 7, 2018 20:58 — forked from mralexgray/gist:5099927
Objective-C Blocks Cheat Sheet
// http://cocoawithlove.com/2009/10/ugly-side-of-blocks-explicit.html has a nice breakdown of the syntax--it helps to think of the ^ as similar to a pointer dereference symbol *
// block typedef:
typedef void(^Block)();
typedef void(^ConditionalBlock)(BOOL);
typedef NSString*(^BlockThatReturnsString)();
typedef NSString*(^ConditionalBlockThatReturnsString)(BOOL);
// block property with typedef: