How to test changes to atom language grammars. - atom-editor

I'm looking to modify a language grammar in atom. However I'm not sure how to reload the grammar in order to test my changes. Do I need to quit and restart each time?

The grammar-live-reload was made for that purpose, so it's probably the most convenient way.
Reload automatically editors when grammars files (.cson) changes [...] Only editors that are affected by the selected language are reload[ed].
Otherwise, you can open the command-palette and run Window: Reload (this will also show its shortcut). You can do the same in from the developer tools' command-palette by running Reload Page or Hard Reload Page.

Related

Downloading Documents from a password required site

I've learnt about wget and have downloaded a few directories from the web. However, I've hit some roadblocks.
I'm trying to download from a site which requires a password and username, which I have access to.
There are no apparent directories that I could find from inspecting elements. The site was loading up the documents in a reader.js (whatever that is) and it seemed that each page was being fetched as I clicked the arrow button instead of the whole document.
Any ideas would be helpful :)
The site was loading up the documents in a reader.js (whatever that
is) and it seemed that each page was being fetched as I clicked the
arrow button instead of the whole document.
This suggest that JavaScript is used to get document, wget is not right tool in such situation. You would need another tool, namely one which provides browser automation, I suggest giving try PhantomJS (if you are tolerating writing in JavaScript-like language) or selenium (if you are tolerating writing in at least one of officially supported languages).

Qt program ignores KDE theme and qtconfig theme

When I run my Qt5 program as a superuser, the program completely ignores any system fonts, themes and icons and uses some bogus theme. See screenshot.
HOW to fix this programmatically or in any way possible??
It also ignores any KDE configs/qtconfig. This is driving me nuts.
Right is run as normal user, left is run as superuser.
Your config is being saved in your user's home. If you open app as root, it is working with root's settings. Easiest way to fix this would be graphical root login, than change settings to what you want and switch back to regular user. Root graphical login is disabled in most distros but you can still do it by using second terminal.
Press Alt+Ctrl+F2 to open a second terminal.
Login as root (password won't appear).
Type startx and press Enter, the GUI should start automatically.
Go for settings, set whatever theme you want, then log out.
Press Alt+Ctrl+F1 to go back to first terminal.
Everything should look nice from now on.

Realtime css/less/scss edition using chrome DevTools in meteor

I want to raise this question again.
What was suggested in the answer to this question is to use old fashioned approach:
Store css in public folder, and incude it via <link href=
Add public folder to google chrome devtools workspace
Not a rocket science at all. Works, but two things I don't like with this approach:
It's still not native and for production I will have to move files from public folder
Each time you edit css, meteor notices changes and reloads application. Author of that answer ignored it.
Basically this result I want:
I start meteor project, open chrome developer tools
Each time I edit css in chrome developer tools it automatically changes in project.
Problems:
Meteor performs concatenation of all css files even with --debug flag on. But provides source maps.
Meteor will still reload after file changes, but fortunately for styles meteor performs soft injection, I would call it, so page will not really be reloaded. It's okay and not really a problem.
Because of 1st problem and this bug I can not get it work.
This feature is very important for me in terms of productivity.
I would offer a good bounty for some guru, who could give me a direction to solve this. Maybe you point me to some starting points to make a plugin for chrome, this also would be acceptable
The way I do it is pretty simple.
Open your website
Right click -> inspect element
Click on Settings - (the wheel in the top right corner).
3.1. Select General tab and look for Sources label (around the bottom). There search for Enable CSS source maps and Auto-reload generated CSS. Check both. You can check all the features if you want.
Select Workspace tab and add the project folder.
Refresh devtools/browser and repeat everything to step 2.
Now, open the Source panel (Elements - Network - Source). Navigate through your folder and find the css file.
Right click on it and select Map to file system resouce. A window with few css files should appear (depends on your projects config).
7.1 Select the css file for your project. A popup asking you to restart devtools will appear. Click ok. Enjoy.
I haven't tested this with Meteor, but for Harpjs & static HTML files the Chrome LiveReload extension will inject changes in Chrome Dev to the actual file.

Putting a JS sourcemap in a password protected directory

I've recently started using uglify-js to compress my JavaScript. Source maps are a nice feature for debugging but, for us, part of the benefit of compressing our JavaScript is the obfuscation.
Would putting the source map in a password protected directory prevent a passive observer from using it to re-beautify our JavaScript? Would his have any undesirable side-effects?
I'm not familiar with how and when browsers request this file. I don't want it to trigger password prompts and inconvenience users but I also don't want it to be publicly viewable.
Well, using Grunt you can set up different routines for dev to production; i.e. you may find Sass comments useful in dev but when you go to production you want all the comments stripped out. Same with sourcemaps. What I like to do is test with minified scripts to make sure everything works before the site goes live, so that my development environment is as close to the production environment as possible.
Ideally, you should have a local clone of your production site in which you can bugfix, enhance etc, rather than debugging a live site.
Yes it's possible someone can still take your JavaScript and beautify it again, but I think they would need the (uncompressed) source files, which you wouldn't store on your website in the first place; all they'd then be left with is beautified JS that had 1 character variable and function names, practically useless to anyone :-)

Can I make the download dialog box appear without "save" option?

I have a hyperlink to an executable like so: Run Now
I'm trying to make the download dialog box appear without the save function as it is to only run only on the user's computer.
Is there any way to manipulate the file download dialog box?
FYI: Running on Windows Server '03' - IIS.
Please no suggestions for a WCF program.
Okay I found it for anyone stumbling upon this conundrum in the future.
Add the following tag to your head section: <meta name="DownloadOptions" content="nosave" /> and the file download dialog box will not display the "save" option.
For the user to not open/run but save replace "nosave" with "noopen"
Not unless you have some control over a user's machine. If your application can run on limited resources, you might want to consider doing it in Silverlight.
IMO, having a website launching an executable is a pretty bad idea.... even worst if that website is open to the general public (not on intranet). I don't know what that app is doing but it sure is NOT, 1) cross browser, 2) cross platform, and 3) safe for your users.
If you are on intranet, you might get away with giving the full server path (on a shared drive) to the executable and change security settings on your in-house machines.
Other than that, you won't succeed in a open environment such as the Internet.
From your comments, if the user downloading the file is the issue, then there's no way to get around it, as they have to download the file in order to be able to run it.
There's any number of ways to get around whatever you could manage in browser, from proxies like Fiddler intercepting the data, or lower level things like packet sniffing. Or even simply going into the browser's temp/cache folder and copying the file out once it's running.
You could probably get around most laymen by having a program that they can download that registers a file extension with Windows. Then the file downloaded from this site would have the URL of the actual data obfuscated somehow (crypto/encoding/ROT-13/etc). The app would then go and grab the file. The initial program could even have whatever functionality provided by what you want to download, but it needs the downloaded key.
But this is moving into the area of DRM and security by obscurity. If an attacker wants your file, and it's on the Internet, they will get the file.

Resources