How to compile source file - sublimetext2

I really love Sublime Text 2 and I want to use it for Software programming.
The problem is that our source files are stored on a Linux server and we all work using PuTTy to connect and Vim to edit the code. We can compile the source by executing a command in PuTTy.
I want to use Sublime Text 2 for coding (the folders in Linux are mounted on our Windows system so the files can be opened in Windows). But whenever I want to compile, I have to open PuTTy and compile manually which asks a lot of time. Can I automate this somehow? Like if I push a button (F8 for example) then PuTTy opens, connects to the Linux server with SSH goes to the correct folder and compiles the source file. Is this possible?
Thanks for any help!

Sublime Build Systems can be used to launch a process like this.
I'm not sure if you can automate anything using putty. But the fork named ExtraPutty allows this: it is scriptable using Lua, an you can launch a script from command line.
If you arefamiliar with Javascript, another alternative would be to use Grunt + a module like SSH2 to automate you compilation process, then launch it from a Sublime build system. The ssh module does not allow interactive commands to be scripted, so I recommend you to use SSH2.
There are many other options; pick the one with which you're the more confortable, then use Sublime Build system to launch it.

Related

VS Code linking launch configuration to commands from command pallete

I am trying to make a VS Code extension where the launch.json would have launch configurations that link to the command palette.
Specifically, I have registered commands using vscode.commands.registerCommand("CommandA"). Is there a way to make it so that the launch.json would direct to "CommandA"?
EDIT: I basically want to run a command from package.json
You can use have a launch configuration run a registered command from the command palette using command variables.

how to run dotnet core's standalone program on mac

a rudimentary question, but please let me know.
I want to run the following program which will process and return the result by json when accessed by GET or POST.
FileManagerController.cs
For example, in PHP you just need to place it in the htdocs folder of Apache.
I would like to do the same thing with dot net core mvc.
but I don't know what kind of words to search.
Also, in the near future we would like ruby to work the same way in another project.(In a way that doesn't use a framework such as rails)
So, please tell me how to find out how to run various languages alone on a web server.
You need to make a "project" (file type .csproj) that you can build and run on your machine. Check out the Getting Started with ASP.NET page for instructions to install the SDK and create a new project and run it.
To run your code file above, you can:
$ dotnet new mvc
Copy the above FileManagerController.cs file into the generated Controllers folder.
$ dotnet run
Your app will be running on http://localhost:5000, you can hit your web site using the url /FileManager.

How can I test my locally stored webpages?

I have my HTML pages locally stored on my Mac. I already bought the domain and the hosting service. There's a way with which I can test these local webpages so that I can see how they render on different devices? I have heard about local server for testing or using devices via USB attached to the PC. Is there not a more standard and unified way to testing them? It can be everything (software, online services, ...) I'm not interested in emulators/simulators.
If you have only html and/or Javascript code:
Open it with your browser, it will be enough
If you have PHP code:
Install a local web-server (Ex: Apache)
If you have MySQL code:
Install a MySQL server
Usually, installing Mamp (or an equivalent for Android/iOS) is enough to do every basic things. It will provide you SQL and PHP server
Hope it helped you
Creating a local server: Node.js and BrowserSync
I've found a very simple way to test webpages (in my case, HTML5 pages) that are saved in PCs memory so that we could test them directly into all the different devices available, without using simulators/emulators.
The solution is creating a local server using two great totally free tools: Node.js and BrowserSync. Before writing this answer, I tried this solution on my own, and I was completely satisfied of the result! You can find the source for this answer at JavaScript Kit.
Here you are the main steps:
Install Node.js (verify if Node.js is correctly installed with the node- v command from the terminal);
Install BrowserSync using npm install -g browser-sync directly from the terminal. Be careful you need root permissions (I simply used sudo npm install -g browser-sync);
Run BrowserSync:
Navigate to your target directory (the one which contain the static files used to create the website, that's the HTML (and CSS) files) using the command line (to make an example, it could be cd folderA/folderB);
Create a local server inside that directory, with browser-sync start --server.
These are the main steps, but you can directly read the solution from the original source I linked some lines before.

Sublime Text 3 - Sublime Linter 3 - Why isn't "HTML Tidy" working?

I'm a brand new coder trying to wean myself off of the Codecademy web environment. I'm using Sublime Text 3 in tandem with Sublime Linter 3 in order to approximate the real-time error-checking to which I've become accustomed from Codecademy's site.
I know that each linter needs to be installed separately in ST3 and I've successfully integrated "csslint" and "jshint". Both work properly.
Now, I'm trying to get an html linter to error-check my html code and I can only seem to find "HTML Tidy", which I have installed via package control. Unlike the aforementioned linters, which simply require a pre-defined command line string for input at terminal, online tutorials have me installing "HTML tidy" via a winrar executable.
Now I am regrouping and would greatly appreciate any feedback you can provide that might move me incrementally closer to having a working HTML linter. I am using a windows xp computer. Many kind thanks for your help.
According to the Installation Instructions for the plugin, there is a Windows binary for Tidy available here.
For some background, Tidy is a command line tool that comes pre-installed with Mac and Linux but not Windows. Downloading the binary mentioned here and placing it in your path will allow it to be run. To check where it should be placed, run echo %path% from the command line.
Once that is there it will work. To see the available arguments to be run with Tidy, run tidy -help from the command line. These arguments can be added to "args" linter settings.
Just copy tiny.exe to folder C:\Windows\System32\, and restart ST3.

Is it possible to specify Windows shell to use when specifying hooks in Mercurial?

I am trying to set up a hook on a remote repository (using hgweb) on a Windows IIS server. The issue I have is that the repository is specified as a UNC path in hgweb's config, and the hook executes cmd.exe using a UNC path which cmd.exe does not support.
Is it possible to specify a different shell to run instead?
As far as I know, you can't tell Mercurial to use a different shell on Windows (but I think you can on a Linux host)
Instead, you could have your hook script call out to a different shell and have that shell execute another script or set of commands. It's messy, but unfortunately Windows isn't know for having great scripting support, especially when compared to *nix-based platforms.
Mercurial hooks can be defined two ways,
as a shell hook (external hook)
as a python hook (in process hook)
if you change it to be a python hook, then you would obviously have the full power of python available to do stuff. Of course there is no reason why you can't write a program in any language and execute it from your external hook as cdeszaq suggests