Skip to content

Instantly share code, notes, and snippets.

@yiding
yiding / osx-man-xcode.md
Last active October 29, 2022 18:20
Man pages on OSX + Xcode Developer tools

OSX's man utility has custom patches to allow finding man pages from installed Xcode SDKs.

#ifdef __APPLE__
	xcselect_manpaths *xcp;
	const char *path;
	unsigned i, count;

	// TODO: pass something for sdkname
	xcp = xcselect_get_manpaths(NULL);
@yiding
yiding / patch.diff
Created April 22, 2014 23:35
topgit-0.9 patch for homebrew
diff --git a/Makefile b/Makefile
index 3ce39a5..2926f9e 100644
--- a/Makefile
+++ b/Makefile
@@ -3,7 +3,7 @@ bindir := $(prefix)/bin
cmddir := $(prefix)/libexec/topgit
sharedir := $(prefix)/share/topgit
hooksdir := $(cmddir)/hooks
-
+sed := gsed
@yiding
yiding / xmonad-dzen.hs
Created February 22, 2014 22:30
XMonad dzen loghook that respawns dzen when screen size changes
{-# LANGUAGE FlexibleContexts #-}
import XMonad
import Control.Monad.Reader (asks)
import Control.Concurrent.MVar (MVar, newMVar, modifyMVar)
import XMonad.Actions.GridSelect (goToSelected, defaultGSConfig)
import XMonad.Util.EZConfig (additionalKeys)
import XMonad.Hooks.DynamicLog (PP(..), dzenPP, dynamicLogWithPP)
import XMonad.Util.Run (spawnPipe)
import System.IO (Handle, IOMode(WriteMode), hPutStrLn, hClose, openFile)