hook

How to properly use post-receive hook?

允我心安 提交于 2019-12-11 07:12:47
问题 My directory structure is: ~/parent.git/.git/hooks/post-receive The post-receive hook looks like: #!/bin/sh git checkout -f When I push into parent.git, the script does not run. I can't figure out the problem, as every bit of the internet says this should work. I chmod'd post-receive, so I know that is not the problem. Any help is much appreciated. 回答1: As Chris mentioned you seem to have the same problem as reset hard on git push Specifically hooks run with CWD and GIT_DIR set to the .git

What key was pressed? Keyboard hooks

喜欢而已 提交于 2019-12-11 06:31:26
问题 I'm using low level hooks, but I can't determine what key was pressed. Values are the same for every single key. Is here something I'm doing wrong? Hook method void hook() { /** this part is probably not important since I use global WH_KEYBOARD_LL, is that right? */ HWND hwnd = FindWindow(NULL, "Vertices.exe"); HINSTANCE instance = (HINSTANCE)GetWindowLong(hwnd, GWL_HINSTANCE); /** end part */ SetWindowsHookEx(WH_KEYBOARD_LL, LowLevelKeyboardProc, instance /** or NULL ? */, NULL); } Callback

Git CHMOD post-receive hook

為{幸葍}努か 提交于 2019-12-11 06:20:55
问题 I'm using a bare remote repository on my webserver with a post-receive hook that will automatically push my files in the public_html directory. The problem is, I'm using codeigniter and the index.php file has to be chmod 755. I changed it on the server with filezilla, but after every push the index.php file gets set to 644, which results in an internal server error. This happens even when the index.php isn't changed or stashed.. I've searched for a solution, but so far without luck.. Could

Create TNotifyEvent in C++ for use at Application level

Deadly 提交于 2019-12-11 05:21:53
问题 I need to hook on to the Application's OnDeactivate event in C++ Builder. So I need to write my own function to run when the OnDeactivate event fires for the application, but I don't know where or how to define that function. Ideally I would like my code to look something like this: WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, int) { try { Application->Initialize(); Application->OnDeactivate = myFunction; Application->Run(); } later: void myFunction(TObject *Sender) { //Do Stuff } When I

Getting the handle of the currently focused control inside another application

[亡魂溺海] 提交于 2019-12-11 05:16:38
问题 How would one retrieve the handle of the control that currently has focus ? I am using WH_KEYBOARD_LL to capture all keypresses in, and I should be able to determine in which textbox the user is typing in. The code capturing the events has no direct access to the controls in the other application. I know the win32 function GetFocus() exists for getting the current window handle, but I need something similar for the current control. Any ideas would be appreciated. Pika 回答1: You can pass the

Example of using EM_STREAMOUT with c# and RichEditBox

情到浓时终转凉″ 提交于 2019-12-11 04:22:59
问题 i trying to get a text from a RichEdit field with WM_GETTEXT, but i run into some problems, so I found EM_STREAMOUT, this is especially for RichEdit. I found this code and played a little bit with it, but i can't get them to work: delegate uint EditStreamCallback(IntPtr dwCookie, IntPtr pbBuff, int cb, out int pcb); struct EDITSTREAM { public IntPtr dwCookie; public uint dwError; public EditStreamCallback pfnCallback; } [DllImport("user32.dll", CharSet=CharSet.Auto)] static extern IntPtr

Insert code right after body tag using theme functions

会有一股神秘感。 提交于 2019-12-11 03:59:22
问题 I am trying to add a piece of code at the begining of every page in a Drupal site. Since I have more than one page template, I want to do this programatically... but am not succeeding. I am still new and, though I get the gist of hooks, theme functions, and the such, I just can't figure the correct way to achieve this. So far I've overriden the theme_preprocess_page(&$vars) to add the necessary css and js: function mytheme_preprocess_page(&$vars) { if(condition) { drupal_add_js(drupal_get

Codeigniter Hooks advance

房东的猫 提交于 2019-12-11 03:45:45
问题 Hello i am using post_controller hooks to validate user whether logged in or not But when validation fails i redirect user to login controller.... Now the problem is when it redirect to defaults controller post_controller hooks is called again and in this way infinite loop starts with redirection repeatedly. i want to call post_controller hook for every controller except login controller.... also is there way that i don't need to load session library again and again because, if user is logged

Is there a way to know size of a pointer passed to a __free_hook in Linux?

半城伤御伤魂 提交于 2019-12-11 03:43:32
问题 I want to track how much memory is currently allocated by a large application. I found that I can install hooks around malloc/free/realloc in order to intercept memory allocation calls: http://man7.org/linux/man-pages/man3/malloc_hook.3.html So what I want to track is total bytes allocated - total bytes freed. Now the problem is that free only takes a pointer and not a size. In can create my own map or hashmap in my malloc hook that tracks how much memory was allocated for that pointer but

Strange behaviour of windows hooks

点点圈 提交于 2019-12-11 03:42:27
问题 I was looking for a possibility to be notified in a .NET windows application when any window is activated in the OS (Windows XP 32-bit). On CodeProject I have found a solution by using global system hooks. http://www.codeproject.com/Articles/18638/Using-Window-Messages-to-Implement-Global-System-H . Here is a short summary of this procedure: In an unmanaged assembly (written in C++) a method is implemented which installs the WH_CBT hook. bool InitializeCbtHook(int threadID, HWND destination)