I used that command but forgot how to turn it on:
In sublime console, which is invoked by ctrl+` I typed something like ...
turn_on_debug_mode
... and sublime console started to log every command I run. For example, if I press right mouse button on the view and click Copy file path then in the sublime console I found logging of this action with the name of invoked command like copy_file_path.
So that was an easy way to grab names of commands that I could use in self-written sublime plugins.
The problem is that I do not remember how to turn that debug mode on.
In the console input:
sublime.log_commands(True)
To view keystrokes:
sublime.log_input(True)
Related
While the WebStorm debugger is pretty robust, I prefer the Chrome console. I'm unable to make use of WebStorm's live reload feature, as it a function of the debugger and won't work while the Chrome console is open. Having to manually give Chrome focus every time I want to refresh is a headache, so does anyone know of easy way to trigger a refresh in Chrome without leaving WebStorm?
I happen to be on a Mac, so was able to work out a solution by utilizing WebStorm's External Tools configuration and AppleScript. Here are the steps:
Define an External Tool configuration in WebStorm
Open WebStorm preferences (⌘,)
Go to Tools --> External Tools
Create a new configuration:
Click the '+' button (a dialog will appear)
Set the name/description as preferred
Uncheck Open console
Set Program to osascript
Set Parameters to -e "tell application \"Google Chrome\"" -e "repeat with theWindow in (windows)" -e "repeat with theTab in (tabs of theWindow)" -e "if theTab's URL contains \"localhost\" then" -e "reload theTab" -e "end if" -e "end repeat" -e "end repeat" -e "end tell"
Press OK to save
At this point, you can go to Tools --> External Tools --> to refresh all chrome tabs whose URL contains "localhost".
You can also map a key combination in the Keymap section of preferences
For reference, here's the AppleScript being executed:
tell application "Google Chrome"
repeat with theWindow in (windows)
repeat with theTab in (tabs of theWindow)
if theTab's URL contains "localhost" then
reload theTab
end if
end repeat
end repeat
end tell
Update:
The external tool configuration and keybind is great, but left something to be desired. TypeScript takes time to compile, so after saving I was left spamming my refresh keybind until I saw my changes... What I really wanted is for Chrome waited for all of the TypeScript to compile before refreshing. This is what I came up with:
By setting the command of an npm run configuration to version, you can setup a run configuration that effectively does nothing but invoke external tools (see this post). I used this strategy to create a run configuration first invokes Compile TypeScript and then the Refresh Chrome Tabs script I defined earlier. The key here is that these external tools are run sequentially.
To take it a step further, I defined a macro that will "Save All" and then "Run" and rebound ⌘S to run invoke this macro. Now, whenever I save, Chrome is automatically refreshed after the TypeScript has been compiled, without any additional key presses.
I am building an installer for our product which works well. I've managed to build custom actions to install our services including a MySQL server.
The problem I have is executing a sql file to build the schema structures.
I have a custom action which uses mysql.exe and the command line arguments:
--port=### --user=### --password=### < "[INSTALLDIR]db\EmptyStruct.sql"
It tries to execute this ok but the cmd window which pops up, during the install, just runs through the mysql.exe command line options, which says to me that the command line it gets passed is not correct. However if I run the command manually after the install, it works perfectly.
Does anyone has any ideas please.
I'm making a few assumptions here:
You have a Windows Installer exe custom action that specifies mysql.exe and a command line as you showed
You are expecting the contents of [INSTALLDIR]db\EmptyStruct.sql to be redirected to mysql.exe's standard input
This will not happen. Behind the scenes, Windows Installer's exe custom action support uses the CreateProcess API and this API will interpret command lines literally. However the redirect < needs special handling to actually perform redirection.
To get that behavior, you must use a layer of indirection. For example, you could run cmd.exe as the exe, and give it a command line that will make it interpret and run the command line mysql.exe --port= ... < "[INSTALLDIR]...". However, if you didn't already have a command prompt showing, this would cause one to show up. If you want to avoid that, you could write a custom wrapper that performs the redirection for you, either as a C++ DLL or, say, InstallScript action.
Alternately, if there is a parameter that tells mysql.exe to run a script from a file, you could pass that instead of using redirection. I wasn't able to find evidence of such a parameter in a quick web search.
Thanks for your comments Michael and I used cmd.exe /k AddStruct.bat to accomplish the task!
To clarify, I know there are other file watchers e.g. grunt - which could watch for file changes, then launch Karma from the command line.
What I would like know is how to fire Phpstorm's "run configuration" for Karma on file changes, as it launches in its own tray, has a gui allowing you to click on a test and be taken to the test code etc.
Please try enabling 'Toggle Auto-test' button in testing results window toolbar.
I've installed subl handler, and I'm trying to test it with the recommended:
open 'subl://open/?url=file:///etc/hosts'
Running this in terminal opens the SublHandler.app itself, but then does nothing - it doesn't open sublime text, let alone the file specified.
In SublHandler prefs, I have the "path to subl" set to /usr/local/bin/subl. If I run /usr/local/bin/subl in my terminal, it opens sublime text.
Any ideas as to why SublHandler isn't working?
Looks like the latest binary from asuth is not working correctly on Maverics. Try my fork here https://github.com/grych/subl-handler - it is working on 10.9.1.
I am using firefox extension to run hg commands on my repository. But when ever I execute any hg commands it shows command prompt window for a split second and closes it.
Eg:-
process.run("push");
process.run("update");
Is there any way to not show that window at all ?
Back in the day I used to have a tool that was hidewin.exe that would all you to start any bat file or exe file and have it run invisibly. I tried a google search for it but didn't find it easily but maybe you could have better luck at finding it.