📜 ⬆️ ⬇️

Life hacking in web development

Upgrade your Life

File Open Links in IDE


This will make it easier for you to find the file you need.
You can create links to the code directly on the error page. Or in the error log.
Make links in the dev panel to the controller class and the template file (or what do you have there?)
Clicking on such a link will transfer you to the corresponding file of the open IDE.



How to do?
Register a protocol to open a file or class in the IDE
I use the edit: protocol and this URL scheme
edit: className @ project
edit: relativePath @ project
The program registered for this protocol determines the absolute path to the file and transfers it to the IDE.
')
In Opera, registering a protocol is trivial:
Settings → Advanced → Programs → Add ...
Choose a protocol (no colon needed) and program

For other browsers can be configured in the operating system.
On Windows, this is done through the registry.
In Unix through the ass differently.

Unfortunately, none of the IDEs used by me support opening a file on a particular line through the CLI.
And it would be cool.

upd: vim can, thanks Stdit
vim -c line filename

upd: IDE from Jetbrains also learned, thanks cuhuak
PHPStorm (and, probably, all IDE Jetbrains) can open a file on a specific line through the CLI:
phpstorm --line N filename.

Moreover, if your filename is already open and you are trying to go to another line in this file, then the IDE will carefully smoothly scroll to the right place.

I am glad.

Short cut to project files


Path like / home / Ti / Project / projectname / www breaks the keyboard
When programming, you need to go there or execute programs there.
To this place I create a symlink / w
For project documentation and any PSD, I lead the way / d

In Windows (hi, Document and Settings), you can also create symlinks or connect folders as a disk.

Automatic virtual hosts on a web server


In manual start hosts - spend time
I have done so

CLI Tips


I use the Unix operating system (FreeBSD) and the terminal is my right hand.

A set of scripts for working with projects

When working with a large number of projects, for example, if you work in a web-studio or you are a freelancer, scripts will save your life.

A simple configuration of settings is created for each project:
- deployment options
- connection to the database
- SSH options
- etc.

I use these project management scripts:


SHELL setting

Configure your shell for convenient command substitution, project name substitution in scripts, display of information on the version control system.

thank


In the comments, I suggest habrachelovekam share their life hacking in web development.

Additions


Link to switch between dev and prod hosts

Make a link in the dev-panel to switch between the local version being developed and the working, production, site.
Or use another tool to quickly switch between these hosts.

Add-ons from the comments


Color marking of different servers (thanks, Stdit )

Color the invitations of different servers in different colors. For example like this (.bash_profile):
PS1='\e[32m\D{%Y-%m-%d %H:%M:%S} \w\e[0m\n\$ '

Audible notification of critical errors (thanks, Stdit )

If you follow the logs through tail -f, add the number 7 (\ a) symbol to critical error messages.
This will add a bell to your terminal.

Source: https://habr.com/ru/post/138496/


All Articles