Posts

Showing posts from April, 2020

JavaScript: Countable.js

Image
This article is about a very small, rather unknown,  but a very powerful JavaScript library which will make your life easy without making your web app unnecessarily heavy. Well, this may be useful in a use case, where you need to show count of words, characters,  sentences etc to the end-user which he enters into a text field or to store it in a database for some data analyzing kind of thing. So let's start with some code: <input type="text" id='usertext'></textarea> <script>   Countable.count(document.getElementById('usertext'), counter =>     console.log(counter)   ) </script> Now you should see: {paragraphs: 0, sentences: 0, words: 0, characters: 0, all: 0} With the Countable.count function we get the current state of our text field.  But if we change anything in it now, the function will not be called again. The triggering at every change of the content of the text field can be achi

Javascript: Mousetrap.js

Image
Mousetrap is a small standalone library with no external dependency. It is used for handling keyboard events, shortcuts in the browser. Mostly when building complex UI's, it is helpful or necessary to provide the user with keyboards shortcuts. This is also conceivable in video games or something like that. Let's look at the example: Bind a single Key: Mousetrap.bind(‘4’, function() {   console.log(‘you pressed 4’) }) Note: It makes a difference whether it is a capital or small letter that was defined or pressed. For Mousetrap, for example, x is not equal to X. Bind a single key, trigger the function when you let the key come up, after holding it down. Mousetrap.bind(‘x’, function() {   console.log(‘You pressed x and let it come up’) },‘keyup’) Trigger when the a, b & c keys are pressed in sequence. The specified sequence must be observed. Mousetrap.bind(‘a b c’, function() {   console.log(‘You pressed a, then b & after that you pressed c’) }

BrainPickings: Maria Popova

Image
This article will link those, who love to read about arts, science, and biography to the perfect place. Brainpickings.org  is just the right thing. Well, brainpicking is a famous blog by  Maria Popova . Maria Popova is best known for her insightful and eclectic writing. She writes about whatever she reads in her blog. She started her journey on October 23, 2006, like a weekly email to his seven friends, which eventually brought her online and now it is included in the  Library of Congress permanent web archive . She is also the author of a very long, very yellow book titled  Figuring . She says it is the distillation of her lifetime’s reading on science, the arts, and biography.  Well, this was a very short introduction to her. I would insist you too read her blog and get yourself enlighten.   I hope you like this short informative article. Do share it with your friends. WRITTEN BY: saurabh Joshi

Node JS:Understanding bin in package.json.

Image
Well as a Node Js developer we know package.json as dependency file where we keep a note of all dependencies of our project. Here we will be looking at what is bin in package.json? To understand this we first need to understand command line application and it's purpose. CLI applications are mostly used to automate things such as deployments of application,running tests,building reports and the list goes on and on. So lets start with creating our first CLI application. First, let’s make sure you have the tools required. To complete this tutorial, you will need the following: 1)A recent version of Node.js downloaded and installed 2)A good text editor, such as Visual Studio Code Next, open your computer’s command prompt (Windows) or terminal (macOS/Linux). Change the current directory to the folder where you save your documents or projects. Enter the following commands to create a new project folder and initialize the project. mkdir hello-cli cd hello-cli npm init Nex

4 Things you can do in lockdown for Self Growth.

There are like many things that you can do in lock down  but if you don't know from where to start  than this article might help you with some direction. I have specifically mentioned some apps on android that might help you with these things. 1)L istening Audio Books:  Reading a book on phone  might be stressful or like you may not have books available at your place.So instead you can listen to many books with different languages on Story Tell android app .You can download it on playstore. It also have 14 days free subscription presently. Start with some best seller books like Subtle art of not giving a fuck, How to Influence people and many more regional books which will help you to grow. 2)Learn Musical Instruments :  You can start learning different musical instruments on android apps which are way too good .One such app is Walkband  .Its free and available on play store.You can easily start playing piano with this app and also you can get piano notes for many songs on y

The story of Hiroo Onoda and Norio Suzuki .

Well the story begins with Hiroo Onodo . A Japanese  Army Intelligence officer who fought in world war II.  On 23 December 1944 he was sent to Lubang Island  in the Philippines with orders which stated that under no conditions he should surrender or take his own life. But after few months The United States detonated two nuclear weapons over the Japanese cities of Hiroshima and Nagasaki on August 6 and 9, 1945 which  ended the World War II as Japanese surrenders.The Philippines forces distributed leaflet announcing that Japan has surrender in Oct 1945,However he and his companion distrusted the leaflet thinking that it was a allied propaganda.As they continue to carry out guerrilla  activities and shootouts with the forces .In 1952 letters and family pictures were dropped from aircraft  urging them to surrender,but they concluded that it was a trick. In 1972 his companion Kozuka was killed by local police. Onoda was now alone. After 2 years  On Feb 20,1974 , Onoda met a Japanese