chrome file system inspection - reload on change - google-chrome-extension

is there an extension for loading an entire page on change in file system in entire folder. I am right now using Tincr but it doesn't allow me watch the entire folder.
there is an auto reload for firefox which watches folder and filters on extension convieniently

Not really the answer you want but:
have you considered writing a script / program that monitors the entire folder and (when a change is detected) "touch"es the file Tincr monitors? that should be simple - and would result in the effect you need.
keep in mind that tincr uses the NPAPI which (according to Google) would no longer be allowed on Chrome come Jan 1st, 2015.

Related

How to watch changes to compiled CSS and update original SCSS?

I know it sounds ridiculous, but Chrome writes to the compiled CSS when using the Developer Tools -> Elements -> Styles with workspace set up. It sees the original partial, but when changing a property, it writes to the compiled (they say it's working as intended, lol). Therefore I would like to:
Watch or intercept 3rd party writes to compiled (changes that didn't occur from the compile due to regular --watch).
Map the change using the sourcemap to the original SCSS file.
Save the changed SCSS file.
That will trigger a new compile. The compiled CSS will probably be the same as how Chrome left it. But this time the values arrive from SCSS and will persist.
I know that if I change stuff on the Sources tab, it does save to the right file. But I don't get a live preview then playing directly with the SCSS file on the Sources tab, only if I save. My workflow includes changing the design live on the Elements -> Style tab, then (for now) copy pasting the values I like to the file. If I have to switch to the Sources tab and I see the unchanged original values there (paste the changes, save, refresh), I might as well just switch to VS Code to do the same thing, it defeats the purpose of how it should work (when no SCSS is thrown into the mix).
I'm using sass from npm but I see this reverse sync would be the task of a custom script that can somehow distinguish the process that wrote to the file to avoid an infinite loop. The files are local but in an Ubuntu VM that has a samba share so they are accessed via a drive letter in Windows (Chrome is told that path). The solution just has to work, I don't care what language or platform.

How do you make a specific folder that has subfolders to be uneditable in Sublime Text

How do you make a specific folder that has subfolders to be uneditable in Sublime text? ? I know it's possible but how ? Like i have some old projects that I want to use as a reference to study my old code, but i"m worried that I mistakenly edited some parts of that specific module / file, when I'm mindlessly touring around my code.. How do I do it ? like making a specific folder to be uneditable in sublime text that only modifying it can change it . I mean I tried installing this one package : https://packagecontrol.io/packages/Toggle%20Read-Only
But it still gives me a prompt whenever I want to changed something from a file
Your best bet is to make sure that your source code is covered by some sort of Source Control, such as git or Subversion; this is just always a good idea in general and unrelated to your particular question. Having your code under source control means that when you edit a file (accidentally or on purpose) you can see exactly what you edited or throw those edits away and go back to what you had if you want to. If you also push your code to an external server, such as GitHUb (if you use git) then you also have a cheap and easy off-site backup of your code as well.
That said, if you want to make files uneditable, that's more the job of your file system than the tools that you're using to edit the files (in this case Sublime Text).
All file systems and operating systems should have the concept of a read-only file, which sounds like what you want. A file being marked as read-only stops you from accidentally modifying it; depending on the software that you use, edits are either impossible or will need to be confirmed.
In your case, you can do this in a couple of different ways. If you only want to protect a couple of files, then you would do a Right click and choose Properties; in the bottom of the General tab there is a check box you can check to make that file read-only:
If you have many files, you can do the same thing by editing the properties of the folder that contains the code instead:
When you do this to a folder, the property set works a little differently; since you're modifying the folder as a whole, you need to click the box twice to change it from a square (shown above) to a check mark. When you apply the change, you will be asked if you only want to make files inside of that directory read-only, or all files in that folder as well as all folders under it; choose as appropriate.
Sublime will let you open read-only files and will also let you modify their contents, but when you try to save you will get a warning dialog telling you that the file is write-protected; you need to confirm if you want to actually save changes or not; (other software may not prompt with such a dialog and may just fail):
If you choose to save, you will remove the read-only attribute and make the file normal again.
If you want to make a file completely un-editable so that you can't even accidentally change the file, you can achieve that with a simple plugin in combination with making the file read-only (see this video if you're not sure how to apply a plugin):
import sublime
import sublime_plugin
import os
class ReadOnlyListener(sublime_plugin.EventListener):
def on_load(self, view):
if (os.path.exists(view.file_name())
and not os.access(view.file_name(), os.W_OK)):
view.set_read_only(True)
EDIT: The internal View Package Files command will open package resources from sublime-package files transparently and give them a filename that represents where they would exist on disk if they were not in the package file.
The plugin from the original answer would stop you from being able to use this command by noting that the file is not writable (because it does not exist on disk) and make the view read-only, which stops the file content from being displayed because the view can't be modified.
This is rectified in the edit above by only taking action if the file actually exists on disk (the View Package File command already makes files it loads in this manner read-only if they do not exist on disk).
This makes an event listener that checks every time you open a file to see if the file is writable, and if it's not it makes the view read-only. This distinction is Sublime specific; regardless of the underlying state of the file, you just can't make any changes to such a file at all. That doesn't stop you from saving the file even if you haven't made any changes, which would have the same effect as the above.

How to make PC unzip a downloaded file with one click in Chrome? Macs do this, why not PCs?

How do you make a PC unzip a downloaded file with one click in Chrome? Macs do this, why not PCs?
On my Mac, when I download a .zip file, it shows in the bottom bar of Chrome. If I click once on that download in the Chrome bottom bar, it unzips the archive into the same directory ("Downloads") without any further interaction from me.
How can a PC user get a file to unzip with that same convenience? Everything I've tried requires you to go to make two or three steps.
Here's how to do it. It is not nearly as seamless and quick as on a Mac, but it works without any user interaction by monitoring your download folder for archives. When one shows up in the folder, it automatically unzips the archive and can optionally delete the .zip, or run a command line, or what-have-you. On a slow PC I tested it on, it took about 40 seconds to recognize there was a new archive and to process it. Hopefully that's faster on faster PCs.
Here are the basics:
download ExtractNow onto PC from http://www.extractnow.com
in the Settings tabs, under Monitor, select the path to the folder want to monitor and check the "Automatically extract" checkbox.
That's basically it.
Additionally you can run a command. I needed to do something a little unusual - open an .html file from the just-expanded archive using Microsoft Word - and I was able to get it to do that automatically. Here's what I entered in the Process tab under the "Archive operation complete" section:
check the "Run a program" checkbox
in the Command: box, enter this:
winword {ArchiveFolder}"{ArchiveName}.html"
You can tweak that for your circumstances. The point is that ExtractNow can pass info about the archive (the name, the path, etc.) in bracketed, named variables so that you can use them to invoke other commands or processing.
I don't love the time lag, but it completely does what I wanted and more. Cheers!

Unregistered Sublime Text

I downloaded Sublime Text 3 on my MacBook Air; however, the text editor continues to have UNREGISTERED on the top right hand corner of the tab. As a result, I presume, I cannot save anything in the said text editor. How do I fix this?
Sublime Text is fully functional in it's unregistered evaluation mode with the exception that:
It reminds you every few saves to purchase it if you're going to use it for an extended purpose (i.e. it's not free to use forever, despite what many web pages and users claim)
You cannot turn off update checks at startup to gently remind you that as an unlicensed user, you should be running the most recent version.
The error that you're seeing isn't Sublime telling you that you can't save because it's unregistered, it's MacOS telling you that you can't save files to the root of the file system (/).
On Unix-like systems such as MacOS and Linux, non-administrative users aren't allowed to save files anywhere but their own home directories (and a few other places, like /tmp) unless you specifically set things up to allow it, because indiscriminate creation or editing of files in the wrong place can cause problems.
As such, if you pick a different folder (somewhere under /Users/yourusername) to save in, it will work as you expect.

Making Chrome/Firefox Reuse Existing Opened File

I've added logic in Emacs to automatically call browse-url on a DMD generated html documentation file upon completion of a special build finish hook I've written.
In order for this to be usable I now want this call to only open a new browser tab the first time it is called and the rest of the times only reload the tab already showing the the doc file.
Is this possible, preferrably in Google Chrome?
I've scanned command line arguments for both GC and FF but have found nothing.
I suspect some Javascript/HTML-5 may do the trick but I know nothing about that.
For Firefox look into browse-url-firefox-new-window-is-tab and / or browse-url-maybe-new-window. You could follow the execution path from the definition of browse-url-default-browser, all in the browse-url.el.
But the basic idea is that you could just look at how, for example, browse-url-firefox is implemented, write the one that does exactly what you want (launches Firefox in the way that you need), and set it to be the browse-url-browser-function. The value of this variable must be a function which is called from browse-url.
What is interesting (perhaps something similar is available in Google Chrome), there's MozRepl, obviously, it will run in Mozilla browsers, and there's a binding for Emacs to talk to this REPL (interactive JavaScript interpreter). Using that you can have very fine-grained control over the behaviour of the browser, including, but not limited to creating new GUI components (using XUL), manipulating browser windows and so on. Would probably depend on how much time you are willing to spend on it.

Resources