Skip to main content

24 posts tagged with "vscode"

View All Tags

Quarto Callout Blocks

3 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Quarto Callout Blocks

A callout (called admonition by Docusaurus) is a special syntax used to highlight a paragraph, f.i. a Pay attention to... or Tip: Did you know that... box.

On this blog powered by Docusaurus, the syntax for admonition is

:::caution[Pay attention to...]
Never give your bank card code to a stranger.
:::

and this is rendered like

Pay attention to...

Never give your bank card code to a stranger.

And now a nice tip:

Did you know that...

By going to bed earlier, you'll get better quality sleep.

Quarto implements this a little differently, so let's have a look...

Error Lens addon for VSCode

2 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Error Lens addon for VSCode

Very recently I discovered usernamehw.errorlens and it's a shame I hadn't seen it before.

Error Lens is an addon for VSCode which will show errors, notices, warnings, etc. in the editor, which are generally only accessible in the Problems area of VSCode.

Did you know where is that area? In the status bar of the main VSCode window. Did you see it? Hardly anyone sees it, and yet it should be!

Status bar

We can see here I've 54 problems, ouch.

Tabnine - AI Autocomplete & Chat for Javascript, Python, Typescript, PHP, Go, Java & more

2 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Tabnine - AI Autocomplete & Chat for Javascript, Python, Typescript, PHP, Go, Java & more

Tabnine is a MUST HAVE extension. He will predict your next keystroke and sometimes it's just WOW; HOW IS IT POSSIBLE?.

Imagine you've a private string $firstName property in PHP. By starting to type private function set, Tabnine will understand you're probably creating a setter and will then suggest setFirstName(string $firstname).

<?php

class Customer
{
private string $firstName;

private function set // <=== Tabnine will predict and propose setFirstName(string $firstname)
}

Install a PHP Docker environment in a matter of seconds

4 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Install a PHP Docker environment in a matter of seconds

This article is the very short and straightforward version of PHP development in a devcontainer with preinstalled code quality tools. If you just want to follow a very few steps and get your PHP environment, this article is for you.

By following steps describe in this article, you'll obtain:

  • A Docker PHP environment so you can code using vscode,
  • The PHP composer package manager installed,
  • A few static analysis tool like php-cs-fixer, phpcs, phpcbf, sonarlint and Rector installed
  • A devcontainer ready-to-use environment.

Just follow the guide...

The aim of this article is to create a development environment (aka devcontainer)

Please refers to my other articles about Docker to see how to Dockerize the application and be able to run the application using Apache and a database service like PostgreSQL.

PHP development in a devcontainer with preinstalled code quality tools

22 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

PHP development in a devcontainer with preinstalled code quality tools

Don't want to read this long article

Let's imagine one of the following situations:

  1. You are working with several people on the same PHP project and you notice that one or other person does not comply with your quality criteria when it comes to the layout of the code. You like to use four spaces for indentation, you want the brace that marks the start of a function to be on the line, you don't want to see any more useless spaces at the end of the line, ... and damned! you notice that some people don't care about this.

  2. You are working alone on a project and don't want to lose time to configure your VSCode experience. You wish to start very quickly with a lot of tools already installed in VSCode so you can put your focus to the code, not the editor.

The ultimate solution: using a devcontainer in VSCode.

By using a devcontainer, you (and your team colleague) will use a preinstalled environment and everyone will have exactly the same. You'll save yourself a lot of time by not having to configure your system, and you'll be able to start coding straight away, supported by a range of quality analysis tools.

Markdown linter - solve formatting issue in md files

2 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Markdown linter - solve formatting issue in md files

You are writing Markdown .md files (and you're so right) and you just wish to check (and autofix) some issues like having multiple blank lines, mixing bullet types (- and * in the same document), using a # title followed by ### (i.e. you forget the level ##) and many more.

There is a tool for this: Markdown lint and, a Docker image peterdavehello/markdownlint.

Let's learn how to use it.

Autosave feature in VSCode

2 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Autosave feature in VSCode

How many times have you modified a file in vscode (and forgotten to save the modification) in order to refresh it from your web page, run the script from your console, etc., and then thought Oh no, damn, it still doesn't work?

And it can take several minutes and back and forth before, damned, silly me, I didn't save my modification.

And even more so when you've done a Search&Replace in several files; some having been saved and others not.

Let's see how to avoid this.

Rendering a JSON file as a mind map

2 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Rendering a JSON file as a mind map

https://jsoncrack.com/editor

I really like the idea of not having to draw (actually, that is just because I am really bad at it) a diagram, a flow chart, a graphic representation of something that ... can be written.

Json crack is one of the tools in my toolkit when I want to draw something that can be written in json.

Create your Joomla website using Docker - Part 1

25 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Create your Joomla website using Docker - Part 1

  • Updated 2024-03-23, adding health condition in yml and update Joomla tag to 5.1-php8.2-apache.

In this article, we will learn how to use Docker to install Joomla on your localhost and start a new website in seconds (don't want to wait? Jump to the "Final composer.yaml" chapter).

I will use a Linux console (I'm running WSL on my Windows computer and I have chosen Ubuntu for my distribution) but since Docker can also be used on Windows, you can perfectly run, exactly, the same commands in an MS-DOS / Powershell console.