Dec 20, 2020AWS Cognito UI CustomizationAWS Cognito gives quite poor options to customize the auth popup We cannot add new elements, cannot create new inputs for extra css styles, etc. But there is way to make it a little bit more flexible. First of all, let’s download current (default) css the popup is based on…AWS2 min read
Oct 17, 2020Display ‘Show Desktop’ icon in the taskbar Windows 10In Windows 10 I always suffered without the old good thing: Since Windows 98 through Windows XP and Windows 7 it was becoming smaller and harder to find and finally disappeared completely in Windows 10. So, let’s bring it back! Create Desktop.exe file, empty for now. Right button click on…Windows 102 min readDisplay ‘Show Desktop’ icon in the taskbar Windows 10In Windows 10 I always suffered without the old good thing:Since Windows 98 through Windows XP and Windows 7 it was becoming smaller and harder to find and finally disappeared completely in Windows 10. So, let’s bring it back!Create Desktop.exe file, empty for now.Right button click on…----
Aug 2, 2020Array.prototype.map(parseInt) tricky questionWhen I ran the following JS I surprisingly saw the result [1, NaN, 3] instead of [1, 7, 11]. But if we try parseFloat the result is correct [1, 7, 11] If we try the extended form of parseInt we get the proper outcome as well. So…Java Script1 min read
Jun 22, 2020JavaScript string memory leakIf you create the following HTML file run it in your browser and open the task manager you could notice that the browser takes some limited amount of memory ~200Mb. But what if we update one single digit in our code i.e. replace 12 with 13, run it…Java Script1 min read
Jun 14, 2020Upload Video in chunks with preview and progress bar using JavaScriptSo, we have 3 following goals here: Preview video before it is uploaded Upload video file in small chunks Display a progress bar All these tasks are achievable with JS and jQuery without any other libraries. For choosing a video file we will use the standard input element So…Java Script1 min read
Jun 3, 2020Sweet Alert Dynamic ContentSweet Alert is really beautiful alternative for the boring javascript alert. And it is not just beautiful, it is very powerful popup that allows to do lots of awesome things. But in this post I will show just one feature how to change the popup content dynamically without opening a…HTML1 min read
Published in Code Kings·May 25, 2020JavaScript Array groupBy methodArray.prototype doesn’t have any grouping functionality, so let’s add the groupBy() method. Let’s say we have the following array example: The groupBy(‘Director’) method should return 2 groups — 1st “Christopher Nolan” group and 2nd “James Cameron” group. Every group should contain the list of associated movies. Now let’s have a look at the method implementation. You can try it on JSFiddler: http://jsfiddle.net/AndrewBuntsev/7syen826/Java Script1 min read
Published in Code Kings·May 19, 2020.NET Generic Configuration SectionIf we need to extend an app.config file of a .net application with a deep level configuration section like this we have to create at least 3 classes inherited from ConfigurationElementCollection to incapsulate ‘devices’, ‘touchActivities’ and ‘points’ sections. It could be too much code unless we create generic ConfigurationElementCollection and use it everywhere instead of creation separate classes. The following code depicts that generic implementation:Configuration Management1 min read
Published in Code Kings·May 15, 2020JavaScript Array sort by several parametersArray.prototype allows us to sort array just by 1 parameter. I have created my own method ‘sortBy’ to fix this gap. The method also allows to sort by desc. Let’s say we have the following array The following function call sorts the array by ‘Profession’ then by ‘Name’ descendantly The result will be the following: Now let’s have a look at the method implementation. You can try it on JSFiddler: http://jsfiddle.net/AndrewBuntsev/cwt2gbej/Java Script1 min read
Published in Code Kings·May 10, 2020Sorting C3 chart tooltipC3 is very simple free JavaScript library that allows to create various types of chart literally in few lines of code. C3 is based on D3 so we must plugin it as well That small code snippet produces such a beautiful chart with a tooltip: But as you can see, the data in the tooltip are not sorted. The goal of this post is to show how to sort it. Unfortunately, there is no a simple option to achieve this. We have to override whole the tooltip code for that. The key property here is contents. It allows to use a custom template for tooltip appearanceHTML2 min read