How do I insert the output of rake in Textmate - rake

I've been using Vim for rails app dev.
I am trying to use Textmate.
I have a rake task which generates some text.
How do I insert the output of the rake to the current file?
I do ":r !rake some_task" in Vim.
What's the equivalent for Textmate?
Thanks.
Sam

I'm not sure this belongs on SO, but here's an answer anyway.
Use the Filter Through Command... menu item in the Text menu. For input, select None and output, select Insert as text. The command should be your rake command.

Related

Add completion information for existing CLI utility?

For example, I would like to add completion to adb so that when I hit Tab after adb I can see sub-commands like shell and install. In Bash or Zsh the completion is always in separate file, so this is not an issue. How do I do similar thing in PowerShell (if ever possible)?
Use TabExpansion++.
There is precedent for using a script to generate completers for native commands (see here).
(The comment about PowerShell using Intellisense is incorrect.)

Script in PATH Mac OSX terminal not working

I have the following script in my /path/to/startupscripts directory, so I can open the emacs GUI with the command 'emacs':
#!/bin/sh
/Applications/Emacs.app/Contents/MacOS/Emacs "$#"
I edited my ~/.bash_profile and added the following line
export PATH=/path/to/startupscripts/emacs:$PATH
However, the script is not working because when I type in 'emacs' into the command line emacs still opens within terminal and not the GUI like I want. Also, when I am in the /path/to/startupscripts directory and I can execute and run the script with
chmod +x emacs
./emacs
but even when I type 'emacs' afterwards it still opens within terminal. I am a bit of a beginner, and I think I am missing something painfully obvious.
The PATH should contain a directory name where your script(s) can be found, not the name of your individual script.
You probably need to source your .bash_profile:
source ~/.bash_profile
No changes made in your profile will be applied unless you source the profile or log out and back in.
Aside from that every looks like it should work.
However you may want to consider just using an alias instead of a script for this. This can be done by adding this to your profile:
alias emacs=/Applications/Emacs.app/Contents/MacOS/Emacs
That's probably a cleaner way to get the functionality you want without adding more to your PATH variable.
I hope that helps! [insert obligatory comment about how you should be using vim and not emacs :P]

Run Fiji from command line?

Here is what I want to do:
I want to run Fiji from command-line, to do something like batch image processing. I imagine by typing some command at some console, some batch file can be launched to execute some macro. In this case, the Fiji GUI will not show up, but the processing will be running behind the scene.
Here is what I have done:
I simply tried the FIji headless , but when I tried ./Build.sh misc/headless.jar as the web suggested, the console prompt returns could not find project for artifactID 'headless';
I also tried Javassist,pretty much just built it, but have not figure out how to use it.
Here is the problem I am encountering:
When I type fiji --headless HelloWorldMacro.ijm, nothing happened, where inside the HelloWorldMacro.ijm is printf("Hello world!");
I am wondering, how should I run FIji from command line? Is what I have tried on the right track? If so, what additional work/changes needed to make it work? Thanks a lot.
For the record:
Johannes Schindelin answered this question on the ImageJ mailing list (additionally pointing out why the ImageJ mailing list is the most suitable place for this kind of discussions).
In short, either of the following should work:
fiji --headless --console HelloWorldMacro.ijm
or
fiji --headless HelloWorldMacro.ijm > output.txt
cat output.txt

Notepad++ using "Run" command in a macro

Is it possible to create a macro in Notepad++ that is able to utilize the "Run" command so that I may call an external .exe to operate on the file specified? I am able to do it manually, but when I create a macro that includes the run (F5) and give it a specified command it fails to execute. Is this because the run command isn't supported when creating macros? If so, is there a work-around method?
Thanks
edit: to add context -- I've written a couple ruby scripts to facilitate data-entry that's done using notepad++, and would like to integrate them to the editor. Having them run by a shortcut method created by recording a macro seems to be the best way to do this, unless it's not possible to utilize the run command.
FWIW The Zeus and Zeus Lite editors can do this.
You can do it with the NppExec plugin (available in the Notepad++ wiki ). It allows you to create mini-scripts with keywords that perform commands.
You will also be able to add your script in the contextual (right-click) menu, or assign a shortcut to it.
I personaly uses it to saves a sql file, place myself in the current directory, and then executes isql.exe (external executable) on that file. That simple script transforms my Notepad++ into a rather handy SQL IDE.
I don't think you do it using only Notepad++.
Please see this thread:
http://sourceforge.net/projects/notepad-plus/forums/forum/331754/topic/4805532
If I understood you correctly, you have it all set up but are having issues with running it through Notepad++'s run command?
If so, try what I mentioned here.
I had similar issues with running php compiler and resolved it with the "cmd /c" added like in that mentioned example. And a "& pause" at the end, just so I see what goes on.

Plugin to switch run configuration quickly in eclipse

Is there a plugin which can help to switch run configuration quickly in eclipse?
I am trying to learn django with practice a Eclipse with PyDev. I am follwing this page. This page frequently need to supply different parameters to manage.py, for example:
If you're interested, also run the following commands:
python manage.py validate -- Checks for any errors in the
construction of your models.
python manage.py sqlcustom polls -- Outputs any custom SQL
statements (such as table modifications or constraints) that are
defined for the application.
python manage.py sqlclear polls -- Outputs the necessary DROP
TABLE statements for this app, according to which tables already exist
in your database (if any).
To follow the tutorial, I will need to click the triangle next to the run button , then click "Run Configurations..", then select "Arguments" tab. Modify the argument, press "Apply", then press "Run".
I don't want to repeat each step to have different parameters. Is there other way to do it quickly? Maybe a plugin?
I am not sure if this is the right place to ask, if not, please help to move it to proper place.
Actually, for Django, the PyDev integration should have what you want builtin...
The steps on http://pydev.org/manual_adv_django.html should be more complete, but mainly you have to configure your project as Django and then in any PyDev editor you can do
Ctrl+2 dj (and then press enter)
to open a dialog to choose which django command to run.
Or you may enter the command directly there... i.e.:
Ctrl+2 dj syncdb (when pressing enter syncdb will be run directly)
-- note that it'll use the manage.py configured in the project to which the editor is related to run the command (so, the opened editor must be an editor from the project).
Another option would be right clicking the project and selecting the option under the 'Django menu'.
p.s.: If in some occasion you really had to change the command line all the time, the ${string_prompt} variable could help you -- although other variables in the run configuration could be more suited depending on your use case.
p.s.2: I think you could rename this question to note that what you want is related to running the django manage.py in PyDev (if that's really your use case).
Eclipse Runner could do this for you.