How is gulp-bower used and what is it for? - bower

I am trying to solve this problem; Apparently when I use my gulp file I can't link to my bower_components folder.
While trying to come up with a solution, I heard of gulp-bower But the docs seem a little vague. So what is gulp-bower used for? Could this help me?
Anyone run into my problem? Is my gulp file too verbose...
Just as a FYI I set up a components folder which houses index, scss, images and js and I use gulp to stream to a DEV or PROD depending on the situation. But alas I think that maybe the problem...
PATH STRUCTURE

This was supposed to be an answer to your original question, but it's suitable here as well.
You can't refer to scripts that are out on top of serving directory of your web server.
You could however link to it, if you're on linux, that would be a ln -s.
But, there's a better way. Add .bowerrc to where you install your bower components from, and add this to it:
{
"directory": "folder/in/a/serving/directory"
}

Related

Blink.jl load(loadjs!/loadcss!/importhtml!) functions not working correctly

I hope someone here has used the Blink.jl package for building Julia and Electron apps.
I am having problems setting up and using it, though. The issue is with all of the functions in the api provided: load/loadcss/loadjs/importhtml. They do not seem to work, or I might be doing something wrong.
For example:
loadcss!(w, "styles.css")
does not apply any of the styles in the styles files in the directory.
importhtml!(w, 'index.html')
does not display the html page stored in the local directory. The app shows a blank screen.
I might be doing something wrong as i could not find documentation on how to use the package
I think I found out why, the methods take the full path and not the relative paths, even if files are inside the same folder. So, something like this works:
loadcss!(w, "D:\project\styles.css")
but this won't work:
loadcss!(w, "styles.css")

Firefox Addon SDK Error - Module `project/tests/myjs` is not found at resource

As I progressed with my Firefox Addon development, I wanted to restructure into logical folder structures. And for the need, I thought of keeping some .js files under a directory called "tests", the moment I try to load by adding require('tests/myjs.js'), I am thrown with an error as below:
Message: Module myproject/tests/myjs is not found at resource://jid1-sdfe4541dfsafssdfewf45fa-at-jetpack/myproject/tests/myjs.js
Tried numerous attempts as I did not notice any difference than what was mentioned in official document - it always ended in failure and no much results online. It always worked when placed next to main.js on the same directory, but failed when in the sub directory.
Not sure if it is a bug or designed that way, but undocumented. The solution was to rename the folder. As a brute force way, just renamed the "tests" folder to something else, it worked. Worked with various folder names, but did not work with the folder name "tests".
If anyone knows why, would be better to share. Otherwise, I have my solution anyway.

Grails assets directory management

To my Grails project, I use ztree library.
In the css of this library, we have the following :
background-image:url("/ztree/img/zTreeStandard.png")
I have 3 directory in assets/
images/
javascripts/
stylesheets/
I don't want to modify the css to change the path of background-image:url("/ztree/img/zTreeStandard.png").
So, here are my questions :
Is that mandatory to create a ztree directory in assets/ ?
Can I put ztree directory in images/ ?
Thanks,
If you store the image at grails-app/assets/images/ztree/img/zTreeStandard.png, the assets-pipeline plugin should be able to resolve it (I haven't tested this). If it doesn't work, the reason will be because of the leading / in the path
background-image:url("/ztree/img/zTreeStandard.png")
I understand that you don't like modifying 3rd party code, but I don't think you'll have any choice other than to change this to
background-image:url("ztree/img/zTreeStandard.png")
I would recommend creating a assets/vendor directory and you can just dump all your third-party libraries in there. It should be smart enough for you not have to change any paths--though the absolute URLs might mess things up since usually grails is running at http://host:port/app-name/.

Minix3 read only issue

I would just like to know is there a way you can overwrite the main.c file in the kernel folder (dir /usr/src/kernel/main.c) in MINIX 3. I want to change some code in the file (I know the risks involved) but the problem is I can't save it. I've tried logging in as bin and root and still the same issue.
Is there another way of doing this?
I think your problem lies within the fact that you may not have installed MINIX 3 and that you are running it from the ISO or CD-ROM. That is why you cannot write the file, as you cannot write to an ISO or CD-ROM.
Follow this link to install in on a hard disc or virtual drive:
MINIX 3 install guide

How do I update the MATLAB path?

Sometimes when I add a new file to my path, I have to restart MATLAB or it won't be detected. There must be an other way to this!
I have experienced similar problems (Matlab does not notice it when I change a file). Unfortunately, I have no idea what causes it or how to solve it. I usually find that CLEAR ALL solves the problem, but be aware that it clears all variables in the work space. Some 'REHASH' command (e.g., REHASH TOOLBOXRESET) may also be useful.
I'd love to see a better answer; all documentation that I came across seems to indicate that this cannot happen.
Perhaps this is a problem with Matlab caching certain files at startup to improve performance. This happens with files in certain directories.
From Matlab help for path command:
Note (...) Also note that locations of files in the matlabroot/toolbox directory tree are loaded and cached in memory at the beginning of each MATLAB session to improve performance. If you save files to matlabroot/toolbox directories using an external editor or add or remove files from these directories using file system operations, run rehash toolbox before you use the files in the current session. If you make changes to existing files in matlabroot/toolbox directories using an external editor, run clear functionname before you use the files in the current session. For more information, see the rehash reference page or the Toolbox Path Caching topic in the MATLAB Desktop Tools and Development Environment documentation
I've often seen this happen with networked file locations. I don't understand the mechanism, but it definitely happens. A solution that often works:
path(path);
or, if that fails to pick it up, try this: (NB, this will clear your workspace)
clear classes;
path(path);
We did this last one so much, we put it in script on our common code path called:
shazaam;
Yes, my age is showing.
You want the "rehash" function or you need to set the path again using "path(path)" or similar. It also depends on whether you're using a "frozen" path. Look at the help for ADDPATH.
MATLAB will keep a cached copy of the compiled M-file unless it know that you've changed it. If you've created the file or you've edited it outside of MATLAB, then it may not know that it's changed.
This happens to me when the networked drive connection is lost then restored. rehash does not work but rehash toolboxreset does

Resources