Skip to main content

3 posts tagged with "tool"

View All Tags

SQL - Formatting tool

ยท One min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

SQL - Formatting tool

When faced with legacy code, it is often useful to reformat it to make it readable. And from there, the study of the code can begin.

There are plenty of reformatting tools for json, php, javascript and other languages, but far fewer for a query written in SQL.

Just copy/paste SELECT LAT_N, CITY, TEMP_F FROM STATS, STATION WHERE MONTH = 7 AND STATS.ID = STATION.ID ORDER BY TEMP_F in the tool and get

SELECT
LAT_N,
CITY,
TEMP_F
FROM
STATS,
STATION
WHERE
MONTH = 7
AND STATS.ID = STATION.ID
ORDER BY
TEMP_F

Using Postman to play with API

ยท 9 min read
Christophe
Markdown, WSL and Docker lover ~ PHP developer ~ Insatiable curious.

Using Postman to play with API

If you are developing your own API (whatever the language) or if you need to consume some, Postman can be really handy.

Calling an API and getting the response is one thing, quite simple in fact, but a nice feature of Postman is the ability to validate the response like making sure the returned type is, f.i. application/json, the HTTP status code is 200, the response body is a JSON object (or an XML string), that the body contains some required information and so on.

You can also validate the response against a given schema to make sure the structure is well the one expected.

In this article, we'll use Postman like a unit test tool i.e. run checks on our own API and make a lot of assertions. This is improve the quality of your code by hightlighting potentials errors and, for any refactoring you'll do in the future, by running the tests again, you'll make sure you've not broken something; that you don't have any regression. Make sure you've not broken an API when you upgrade some code is gold.

Self-hosted monitoring tool

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

Self-hosted monitoring tool

Imagine you're a web developer or you work in a web agency and you'd like to keep an eye on the sites you've developed for your clients, free of charge. Are these sites online now, or are they down?

This work is carried out by site monitoring platforms. Could you install one on your computer? Of course!