git-clone and post-checkout hook

I suppose you could make a custom installation – rename the hooks in …/share/git-core/templates/hooks to remove the .sample suffix. You could also make a template directory full of symlinks to a hooks directory inside the repository, (e.g. post-checkout -> ../../hooks/post-checkout). Then if the cloned repo contained that particular hook, it’d get executed. You’re right, though, … Read more

Why must SetWindowsHookEx be used with a windows message queue

The low-level hooks, WH_KEYBOARD_LL and WH_MOUSE_LL are different from all the other hooks. They don’t require a DLL to be injected into the target process. Instead, Windows calls your hook callback directly, inside your own process. To make that work, a message loop is required. There is no other mechanism for Windows to make callbacks … Read more

Is there Windows system event on active window changed?

Yes, you can use SetWinEventHook function. hEvent = SetWinEventHook(EVENT_SYSTEM_FOREGROUND , EVENT_SYSTEM_FOREGROUND , NULL, WinEventProcCallback, 0, 0, WINEVENT_OUTOFCONTEXT | WINEVENT_SKIPOWNPROCESS); ……. VOID CALLBACK WinEventProcCallback ( HWINEVENTHOOK hWinEventHook, DWORD dwEvent, HWND hwnd, LONG idObject, LONG idChild, DWORD dwEventThread, DWORD dwmsEventTime) { /* your code here */ }

Scrape / eavesdrop AJAX data using JavaScript?

I’m going to show two ways of solving the problem. Whichever method you pick, don’t forget to read the bottom of my answer! First, I present a simple method which only works if the page uses jQuery. The second method looks slightly more complex, but will also work on pages without jQuery. The following examples … Read more

How to get the word under the cursor in Windows?

On recent versions of Windows, the recommended way to gather information from one application to another (if you don’t own the targeted application of course) is to use the UI Automation technology. Wikipedia is pretty good for more information on this: Microsoft UI Automation Basically, UI automation will use all necessary means to gather what … Read more

Git pre-push hooks

Git got the pre-push hook in the 1.8.2 release. Sample pre-push script: https://github.com/git/git/blob/87c86dd14abe8db7d00b0df5661ef8cf147a72a3/templates/hooks–pre-push.sample 1.8.2 release notes talking about the new pre-push hook: https://github.com/git/git/blob/master/Documentation/RelNotes/1.8.2.txt