Autocompletion based on filenames in a directory - function

I want to have a function in my zsh for faster accessing my todo-files. It should look inside the folder ~/tasks where i put my todo-lists and stuff. Now i want to type task p and when I hit tab, it should use the files in that directory for autocompletition. Can anyone point me some direction? Or share some snippet to work with?
Thanks

This would seem to do the trick:
compdef '_files -W "$HOME/tasks"' task

Related

Files not under caret on new computer

I opened my project on another computer, and the files where I'd been using a file watcher were expanded, like before they used to be nested like home.scss is now after I run the watcher once on that file.
Is there a way to automatically make all the files be nested?
Because when adding new files and folder with git, it would be quite troublesome to go into each and every file in order to make them become nested.
Like I have some minified JavaScript files that used to be nested, but now is expanded for some reason.
Hope you understand. Thank you.
Edit: Nested***
Is there a way to automatically make all the files go under a caret like that?
Unfortunately not. Such nesting information (to "go under a caret" as you are saying) is taken from "Output path to refresh" field of the corresponding File Watcher.
You have to run file watcher for such files at least once in order to see files nested like you have it on your another computer.
Here is how you can run File Watchers manually without the need to modify those files (so no extra history will appear in your git (or whatever VCS you may be using there)).
https://stackoverflow.com/a/20012655/783119
P.S.
In PhpStorm 2016.3 (the next version that will be released in 1.5-2 months or so) such nesting will be done automatically (the most common combinations) so there will be no need to have File Watchers for providing such info.
If you wish -- you can try EAP build right now (EAP means Early Access Program .. which is sort of Alpha/Beta builds (simply speaking).. and therefore some bugs for new functionality might be present and performance may not be optimal).

Post-build event command line; how to level up in path and how to handle spaces

My goal is to copy a XML file from one project to another project in my solution after a succesful build.
copy $(SolutionDir)Xenos.Core.API\XmlDocumentXenosCoreApi.xml $(ProjectDir)App_Data\XmlDocumentXenosCoreApi.xml
This would translate in this.
copy D:\XENOSTFS2015\Sprint Development\Diversification Sprints\Xenos Main\Xenos.Core.API\XmlDocumentXenosCoreApi.xml D:\XenosTFS2015\Sprint Development\Diversification Sprints\Suite\XenosWebAPI\App_Data\XmlDocumentXenosCoreApi.xml
But I want the first argument of copy to be like this, so the solutiondir should go two levels up. A
D:\XENOSTFS2015\Sprint Development\Diversification Sprints\Suite\XenosCoreApi\XmlDocumentXenosCoreApi.xml
Also I'm worried that the spaces will prevent the copy from executing, how can I solve this?
Thx in advance !!

How to setup limeJS in a totally offline workspace

I'm trying to setup limeJS, the issue is the Internet connection is a problem. I had closure library, box2d, closure compiler and closure templates downloaded separately as .rar files, but I can't find a guide anywhere to set it up like this, everyone just uses(and with reason!!!) the python bin/lime.py init command to get it working. I managed to figure out(yay!) how to setup box2d and closure library but what about the other two?
My laptop is running 64 bits Windows 7. Any help appreciated
All I need is an advice on directory structure, like where to drop the compiler.jar and soy templates .js files, so that when I run the update/create command it doesn't try to download the compiler or templates like it does right now.
I got it working, after taking a quick look at the lime.py file it told me everything I needed, for example both the SoyJs templates file and the compiler need to be in the /path/to/lime/bin/external folder and for example, the lime.py file was expecting a compiler file named compiler-dateOfLatestCompiler.jar instead of compiler.jar.
In general, If you have LimeJS built up in one machine using Python and all, you can just copy paste the whole package anywhere you want and use it just as ususal.
You don't need network once you have all the files/codes for Lime is downloaded.
Infact, you dont even need python for normal development tasks(Python is required to build your js file once you complete development though)

i want to know about the code of .exe file which is in command prompt

I have a problem of to open(EXTRACT) a command prompt.
I want to see the code inside this "a*.exe" file.
can u suggest me as if i am not aware of this field(software).
how to extract cmd.exe file.
Generally, you cannot see the code of an executable file (short answer).
Its very easy to reverse engineer .exe's in windows.
Make sure you have 7za.exe in your system32 folder.
In this example i will pull the source of cmd.exe.
copy C:\windows\system32\cmd.exe C:\cmd.7z
7z e c:\cmd.7z
Then you go to the extracted folder from cmd.7z and there you have the source files.
Hope this helps :)
But if you are pretty sure that you indeed have the knowledge and experience you need, you might want take a look at this PE/COFF format specification over here: http://support.microsoft.com/kb/121460
The specification is very clear and concise; it might be just what you want. With some work, you can inspect a PE/COFF file with your program iff you have the right k&e.*
HTH
-- pete
* Heh! Lily Tomlin's Ernestine: " ... 'k' as in 'knowledge' ... "

how to find which libraries to link to? or, how can I create *-config (such as sdl-config, llvm-config)?

I want to write a program that outputs a list of libraries that I should link to given source code (or object) files (for C or C++ programs).
In *nix, there are useful tools such as sdl-config and llvm-config. But, I want my program to work on Windows, too.
Usage:
get-library-names -l /path/to/lib a.cpp b.cpp c.cpp d.obj
Then, get-library-names would get a list of function names that are invoked from a.cpp, b.cpp, c.cpp, and d.obj. And, it'll search all library files in /path/to/lib directory and list libraries that are needed to link properly.
Is there such tool already written? Is it not trivial to write a such tool?
How do you find what libraries you should link to?
Thanks.
Yeah, you can create a pkg-config file which will allow you to run 'pkg-config --cflags' to get the compiler flags or 'pkg-config --libs' to get the linker libraries.
http://pkg-config.freedesktop.org/wiki/
If you're on Linux, just try looking into /usr/lib/pkgconfig to find some example .pc files that you can use as models. You can still use pkg-config on Windows as well, but it's not something that comes with it.