Skip to content

Instantly share code, notes, and snippets.

View mshafae's full-sized avatar

Michael Shafae mshafae

View GitHub Profile
@airglow923
airglow923 / clang-tidy-readability-identifier-naming-google.yml
Last active December 23, 2024 16:33
clang-tidy readability-identifier-naming for Google's naming convention
CheckOptions:
- key: readability-identifier-naming.ClassCase
value: CamelCase
- key: readability-identifier-naming.ClassMemberCase
value: lower_case
- key: readability-identifier-naming.ConstexprVariableCase
value: CamelCase
- key: readability-identifier-naming.ConstexprVariablePrefix
value: k
- key: readability-identifier-naming.EnumCase
@pudquick
pudquick / framework_constants_via_pyobjc.py
Last active May 18, 2021 01:34
Loading framework variables (aka constants) from pyObjC for arbitrary frameworks
from Foundation import NSBundle
# Load the framework bundle by its identifier
Metadata_bundle = NSBundle.bundleWithIdentifier_("com.apple.Metadata")
# Can also use: bundleWithPath or bundleWithURL
# Load the variable aka constant from the framework into globals
# This says to load whatever "kMDSPreferencesName" is and the type should be "an NSObject" aka "figure it out"
# which ends up giving us a NSString which pyObjC bridges to a python string nicely
@num3ric
num3ric / interleave.cpp
Last active December 2, 2020 21:58
In-place array interleaving
#include <iostream>
#include <vector>
#include <algorithm>
#include <iterator>
#include <assert.h>
typedef std::chrono::high_resolution_clock Clock;
template<typename T>