recipe [RECIPE]: distinct operation for array Being web full stack developer after years of .NET work sometimes brings you to a blind alley. For example, such trivial thing as `.distinct()` function for array, which is not
recipe [RECIPE]: array flatten and distinct in TS I caught up myself on a thought that I have looked to a way to flatten array in TS several times this year. Probably, I had bad memory and cannot
recipe [RECIPE]: Capitalize in CSS There are cases when you want your text looks fine as header in browser, but you don't know if text has correct case of the first letter. It can easily
recipe [RECIPE]: Check error throw in jest Jest is something which millions of people uses everyday, a lot of questions are answered. But I keep finding something new for me every day. This is not gonna work:
recipe [RECIPE]: floating rounded table rows with CSS If your designer wants to have table rows floating one above another, with some space between, and having rounded borders, follow this: :root { --border-radius: 5px; } table { background-color: gray; border-collapse: separate;
javascript [RECIPE]: fix vulnerable sub-dependencies in package.json Regular Typescript or Javascript project has number of dependencies from NPM. Most of them have own dependencies, different versions of them. To see them all you can review auto generated
javascript [RECIPE]: draw a hole inside HTML canvas Imaging you (for any reason) need to draw some color area of complicated form in HTML canvas, and then cut a piece of it, like a donut. There is code
javascript [RECIPE]: Callstack in Javascript When debugging legacy javascript code you might need to know who called this function. The simple solution for it - using Error Object, which has stack information. console.log(new
recipe [RECIPE]: bootstrapSwitch events firing If you by any chance still have jQuery and use things like bootstrapSwitch, you can meet this situation: When switch is setup like this $('id').bootstrapSwitch('state', true)you immediately
recipe [RECIPE]: AWS ECS deployment and Health Checks Recently my regular deployment of NestJS Backend API to Amazon ECS service failed without any meaningful reasons. What I see is that Docker container is taken, everything inside is executed
recipe [Recipe]: Save Canvas content to File on server Save to File If you have some logic with images, drawing or blurring in javascript, you might want to save image back to server. Here is how to use toBlob