Skip to content

Instantly share code, notes, and snippets.

@manmal
manmal / print_advertisingid_usage.sh
Created September 14, 2020 08:51
Find IDFA usage in 3rd party frameworks
for framework in Frameworks/*.framework; do
fname=$(basename $framework .framework)
echo $fname
otool -v -s __TEXT __objc_methname $framework/$fname | grep advertisingIdentifier
done
#!/usr/bin/env python
import argparse
import subprocess
import plistlib
import os
import xml.etree.ElementTree as ET
TEAM = '___YOUR_TEAM_ID__'
@chriszielinski
chriszielinski / NSViewController+NSTextField.swift
Last active February 8, 2024 23:23
NSViewController extension for fetching a window title's NSTextField
extension NSViewController {
var titlebarTextField: NSTextField? {
// NSTitlebarContainerView
guard let titlebarContainerView = view.superview?.subviews
.first(where: { $0.className.hasSuffix("ContainerView") })
else { return nil }
// NSTitlebarView
guard let titlebarView = titlebarContainerView.subviews
@romainl
romainl / grep.md
Last active October 14, 2025 19:57
Instant grep + quickfix

FOREWORDS

I don't mean the snippet at the bottom of this gist to be a generic plug-n-play solution to your search needs. It is very likely to not work for you or even break things, and it certainly is not as extensively tested and genericised as your regular third-party plugin.

My goal, here and in most of my posts, is to show how Vim's features can be leveraged to build your own high-level, low-maintenance, workflows without systematically jumping on the plugins bandwagon or twisting Vim's arm.


Instant grep + quickfix

@sts10
sts10 / alacritty.yml
Last active December 20, 2023 13:54
My Alacritty config yml for MacOS (compliant with v 0.4.1-dev)
# Configuration for Alacritty, the GPU enhanced terminal emulator
# Any items in the `env` entry below will be added as
# environment variables. Some entries may override variables
# set by alacritty it self.
env:
# TERM env customization.
#
# If this property is not set, alacritty will set it to xterm-256color.
#
@romainl
romainl / tags.md
Last active March 16, 2025 13:28
Tags

Tags

Setup

Tell Vim to look for tags files:

  • in the directory of the current file,
  • in the working directory,
  • and in every parent directory, recursively,
@tclementdev
tclementdev / libdispatch-efficiency-tips.md
Last active September 20, 2025 20:31
Making efficient use of the libdispatch (GCD)

libdispatch efficiency tips

The libdispatch is one of the most misused API due to the way it was presented to us when it was introduced and for many years after that, and due to the confusing documentation and API. This page is a compilation of important things to know if you're going to use this library. Many references are available at the end of this document pointing to comments from Apple's very own libdispatch maintainer (Pierre Habouzit).

My take-aways are:

  • You should create very few, long-lived, well-defined queues. These queues should be seen as execution contexts in your program (gui, background work, ...) that benefit from executing in parallel. An important thing to note is that if these queues are all active at once, you will get as many threads running. In most apps, you probably do not need to create more than 3 or 4 queues.

  • Go serial first, and as you find performance bottle necks, measure why, and if concurrency helps, apply with care, always validating under system pressure. Reuse

@romainl
romainl / redir.md
Last active September 11, 2025 23:26
Redirect the output of a Vim or external command into a scratch buffer

Redirect the output of a Vim or external command into a scratch buffer

Usage (any shell)

Show full output of command :hi in scratch window:

:Redir hi

Show full output of command :!ls -al in scratch window:

@egmontkob
egmontkob / Hyperlinks_in_Terminal_Emulators.md
Last active October 14, 2025 16:24
Hyperlinks in Terminal Emulators