Why won't AdvancedNewFile plugin show me the folder structure in sidebar? - sublimetext2

I installed the plugin, but when I save a file within a folder like css/style.css it won't appear in its folder structure in the sidebar.
Also, how do I set the 'global' folder location for this project? Or how to change to another project for later?
Maybe I'm missing something the tutor on tuts+ used, so any tips on additional plugins to help with these tasks will be appreciated.

I'll work to address your questions here, but I recommend creating an issue, if there really is one, on the GitHub Page (I'm also the current maintainer of the plugin and I would probably respond faster to issues on the page because I also get email notification from those).
With that out of the way, I'll start on the questions. After you create the file, can you verify it is created?That is, after you create it through the plugin, can you see the file exists outside of Sublime Text? If so, can you give me more information about your setup so I can try to recreate the issue? Note it may also be a bug within the editor itself, but for now let's assume it's not. When you are creating the file, there should be an absolute path in the status bar below the input window. It should say something along the lines of Creating file at ...
There are a number of configurations for you to manage, if you so choose. Details about these can be read about here. These can be setup as global preferences (navigate to Preferences -> Package Settings -> AdvancedNewFile -> Settings - User). This will create a file for you to place your settings. You may look at the README or the default settings to see a list of valid keys. You may also setup project specific settings, which are explained here.
The AdvancedNewFile plugin works, by default, by using the folders in the window it was activated. So by opening a new project/window, you will have a new set of top level folders when creating files. If you did not have any folders open, it will fall back to the home directory.
Let me know if I can clarify anything. I'll try to check back here, but again, creating an issue for any problems would be fastest way to notify me.

Related

Is there a simple way to change multiple image sources at once?

I have dozens of HTML files hosted on a platform that is soon being shutdown. 90% of the images within each HTML file are hosted on the dying platform and thus need to be re-hosted.
Is there a simple tool or method I can use to bulk download all the
images within an HTML file, so I can re-upload them to the new
platform
Is there a simple tool or method I can then use to rename all the references to Images in the HTML to reflect the new file path?
I am just going over my head here I am assuming following;
you have same domain but changing host servers assumption is you have control over code base. In this case then its simply code over the code and directory structure as its using ftp -> download from one -> ftp upload onto another. hypothetically things should work.
you are changing domain so it becomes a programmable issue i.e domain-a.com/someimage.jpg is now domain-b.com/someimage.jpg and it is being fetched by the browser on to which you have no control over.
if for any reason domain were to be the same and directory structure were to change all you had to do run bit of configuration on ht-access or virtual host or what ever and reroute things internally. ht-access example below
RewriteEngine on
RewriteRule ^somefolder/(.*) otherfolder1/$1
server would identify the URI if it matches the condition then it internally forwards it to otherfolder and /$1 appends what ever was after the matching condition e.g. domain.com/somefolder/myimage.jpg now becomes domain.com/otherfolder/myimage.jpg
BUT domain has to be the same because browser has to send it to the server where htaccess is residing. If its on some other server which is dying then solution is of no use.
Which means we have client side issue. Massive overkill hack so I wont even begin going down that track.
Easy but takes bit of time and in longer run helps a lot.
install vs code - if you haven't used this IDE its about time you should it helps you make better progammingly.
make copy of the folder you have where all your code is.
run VScode and go to file menu -> open folder
on left hand side you see files and structure of the folder meaning folder is successfully opened.
once again file menu -> Save Workspace as... prompt will pop up just gave project name or what ever honky doory you like to be. VScode now will configure things for you.
should be something like this
if it does not show then simple click the double file icon side pan will toggle.
now that we are done with this lest do the magic
6) click on search icon something similar to this will appear
little arrow on left gives other options such replace etc
shortcut Ctrl + Shift + F for search Ctrl + Shift + H for search and replace.
What it does it does not just search in a file it searches in all the files in given folder including sub directories and obviously you can replace them.
So you need quick dirty way of doing it which is more smarter than actually going over each file one by one then above would suffice.
Other than installing depending upon number of files it should take few second to a minute.
Ps I have quirky way of naming things probably have dozens of temp strings here and there and at times need to change them everywhere. This is what I do.

Chrome Workspaces - Saves changes in Sources tab but not Elements

I'm trying to setup and use Workspaces on Canary and I'm running into a few issues.
I understand that is still under development but could someone clarify these issues i'm having aren't or are related to the fact that its still under development?
Basically I setup a workspace in DevTools, locating the directory on my file system. Do I need to put anything in URL prefix and folder path input boxes? I've experimented leaving them blank, filling them in etc, but due to the lack of documentation I'm not sure what the correct input is.
Most of the time I run my sites through MAMP so will custom server names alter the configuration?
When I then open open the page I am editing, open the dev tools, make changes in the elements styles sidebar, it doesn't save any changes to the file on my system. But then when I go into the Sources tab and locate the workspace from the slide-out menu on the left, I can make changes to the files directly there. But I have to refresh the browser to see any changes.
I know something isn't quite right because when I watched Paul Irish's little demo a while back, he was making changes in the elements styles bar and seeing the results without refresh and changes being saved automatically. How can I get that this point?
Thanks in advance.
PS. If someone could add chrome-canary and chrome-workspaces tags, that would be great.
Once you have added a local filesystem, right-click a local file in your Sources panel and choose "Map to Network Resource", then select the network resource it corresponds to. That should set up the right mapping automatically.
URL prefix and folder path should correspond to the root of your app (the root url, on the server) and the root folder of your app in the file-system respectively. Alexander Pavlov is correct - if you set the network mapping for an individual file, and restart Dev Tools, these mappings will be made for the entire map, automatically as Dev tools makes the connections. In other words, do it for one file and you may not have to fill in those fields for the workspace yourself, Dev tools will do it automatically. Very handy.

How can I find my working directory?

You'll have to bear with my slightly on this, but please ask if I have left out any pertinent information. I have just taken over a project to create a dashboard for my team. This dashboard has been made using a niche third-party tool that nobody here will have used before. The third party tool auto-generates some code to display "markers" on a webpage. "Markers" being some proprietary code to query a database/apply custom styling etc.
I am trying to display a webpage within the page that has been generated, and I’d like to point this to a local webpage (ie on my C drive). If I pass it an absolute path, then this results in a warning in IE9 as I am mixing data sources - a https website pointing to a http web page. It will display after ignoring the warning, but my userbase is not comfortable enough with computers to ask them to do this.
I believe if I pass it a relative path then it should work, but I can’t find out what directory to base this path off and it doesn’t appear to be anywhere obvious. So, in my current page I have an image with the web address of : https://website:8443/websitereport/images/buttons/locked.gif. What I need to know is where the “websitereport/images” folder is stored so that I can put my webpage in there to give the webpage a relative path. The HTML for this image is :
<img id="dvp_locationbar_lock" class="dvp_imagebutton" style="" dvp_title="ui.tip.lock-page" dvp_image="locationBarPageUnlockedImage" src="/websitereport/images/buttons/unlocked.gif" title="Lock this page">
What are my options for discovering where this folder is stored locally? I am running Apache Tomcat 7.0. It is not displaying if I use the path based off
C:\Program Files (x86)\Apache Software Foundation\Tomcat 7.0\work\Catalina\websitereport
of
\websitereport\page.html
And I cannot find it anywhere obvious in the Apache folder. I have tried :
Searching - no results.
Using PHP to print the current working directory - cannot find out
where to edit the webpage.
Looking at images/information on the existing webpage. They all point
to folders I cannot find.
Inspecting with firebug.
In short, you can't rely on the files being on disk at all - they might be just contained in a *.war file, containing the whole application. Or they might be generated on-the-fly, despite the name sounding like an actual file.
Also, you should not arbitrarily write within a directory even if you find it (my closest guess would be tomcat's webapps/websitereport/ directory if it exists) because nobody will know that something changed during the time since last deployment. So, on the next update of the application, you'll end up overwriting all of your changes again. You typically change the underlying application and redeploy.
You might also find a few references in tomcat's conf/localhost/ directory or even in conf/server.xml, but it all depends on how your server was administered

Opening directories in HTML

In some websites, I see links that look like this:
Link
The link doesn't go to an html file, but a folder (I believe). I was wondering if this has any purpose, and how to do this. Is there a default file to open when opening a directory? Because when I try something like this, I click the link, then I see a list of files in that folder, and I have to click on the proper link.
Everywhere I look, it says you should do links like this:
Link
Should I just let it go? I'm awfully curious.
This is something that is controlled by the web server. Some will look for a file called default.htm, others will look for index.html. It's usually configurable, and sometimes the server may look for any of a number of variations of index or default.
If such a file is not found, the server will often display a directory listing of all the files found in that folder, but usually that's not a good idea for security reasons. Again, this is something that can be controlled in the settings for the server.
Allowing directory listing is VERY dangerous and ill-advised practice. You should hide real directory structure of your site by all means.
PHPDL is a Php script that lists all the files in a directory (except itself of course). What sets PHPDL apart is that everything the script needs is in one file, including the file-type icons it uses.
Note: You can rename the script to anything you want. It will not list itself as a file to download.
This script safe and usefull, see demos:
http://greg-j.com/projects/phpdl/PHPDL-v2.php
http://greg-j.com/projects/phpdl/PHPDL-lite.php

Viewing html in Gitweb

via its tree view Gitweb is a great tool to browse through repository content at filesystem level. In case there are files inside the repository it's then easily possible to simply view/open them with your browser - just click them. Problem is if these are "html" files referencing other resources (pictures, javascript, etc.) a browser can't find them because although they are available in the repository, and also accessible via Gitweb's "tree" view - they aren't served at there expected location by the (Git)web server.
Stupid question: Is it any possible to configure Gitweb to do some sort of magic URL rewriting or whatever else to be able to fully view an html file with all its references in case the html file itself and all referenced content is present?
I actually don't think so.
Current work-around: At the moment I just clone/check-out the git repository into a directory served by a web server. Works, but whenever anyone wants to view an older commit-level I have to checkout another commit-id. The flexibility of just browsing through files AND commit levels is gone. Plus whoever wants to use this work-around must be able to use git. Also people must know another URL to actually see the content from the repository.
Question: Does anyone see a more flexible work-around?