teleren/devto huggingface dataset:
Send Notifications Through Node.js App! 🔥
Tags: node, javascript, webdev, programming
Published: 2022-06-28 05:10:42

In this article, we are going to learn how we can create notifications/reminder in Windows/ MacOS with your Node.js app.

![Sample Shots 1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/303wwzs7dd15l18ukl0a.gif)

## Approach:
To make a notification through our node app, we are going to use [`node-notifier`](https://www.npmjs.com/package/node-notifier) package. It is already a quiet popular package with more than 9M weekly downloads! 

About this package:
![Package Size](https://img.shields.io/bundlephobia/min/node-notifier?label=size) ![Package Downloads](https://img.shields.io/npm/dw/node-notifier?label=Downloads)

##Steps:

1.  **Do the initial setup for node app.**


2.  **Install the package:**

```shell
yarn add node-notifier
```
or
```shell
npm install node-notifier
```

3.  **Quickstart with this short code:** add this code in your `index.js`

```js
const notifier = require('node-notifier');


// Object
notifier.notify({
  title: 'My notification',
  message: 'Hello, there!'
});
```

You can further add more custom option in it like icon, wait for user action, timeout, reply etc.

```js
const notifier = require('node-notifier');
const path = require('path');

notifier.notify(
  {
    title: 'My awesome title',
    message: 'Hello from node, Mr. User!',
    icon: path.join(__dirname, 'coulson.jpg'), // Absolute path (doesn't work on balloons)
    sound: true, // Only Notification Center or Windows Toasters
    wait: true // Wait with callback, until user action is taken against notification, does not apply to Windows Toasters as they always wait or notify-send as it does not support the wait option
  },
  function (err, response, metadata) {
    // Response is response from notification
    // Metadata contains activationType, activationAt, deliveredAt
  }
);

notifier.on('click', function (notifierObject, options, event) {
  // Triggers if `wait: true` and user clicks notification
});

notifier.on('timeout', function (notifierObject, options) {
  // Triggers if `wait: true` and notification closes
});
```

> 💡 Note: This package has its own system requirements.
> - **macOS**: _>= 10.8 for native notifications._
> _
> - **Linux**: _`notify-osd` or `libnotify-bin` installed (Ubuntu should have this by default)
> _
> - **Windows**: _>= 8, or task bar balloons for Windows < 8._
> - _And if not met any requirement then it will use Growl._



More know about this package on: 
- [Github](https://github.com/mikaelbr/node-notifier#readme)

- [npmjs](https://www.npmjs.com/package/node-notifier)

---

_Hit like if you found this article interested and feel free to ask queries!_

---


_Also read:_

[How to send SMS with Nodejs App](https://dev.to/sujeetgund/send-sms-with-nodejs-app-1c38)
[Awesome VS Code Customizations](https://dev.to/sujeetgund/send-sms-with-nodejs-app-1c38)
1642. Leetcode solution in JavaScript
Tags: javascript
Published: 2022-06-28 05:00:53



```
var furthestBuilding = function(H, B, L)
 { 
let len = H.length - 1, 
pq = new MinPriorityQueue({priority: x => x}) 
for (let i = 0; i < len; i++) 
{ 
let diff = H[i+1] - H[i] if (diff > 0)
 { if (L > 0)
 pq.enqueue(diff),
 L-- else if (pq.front() && diff > pq.front().element) pq.enqueue(diff), 
B -= pq.dequeue().element else B -= diff if (B < 0)
 return i 
} 
} 
return len 
};
```
How to create neon text using vanilla CSS
Tags: css, beginners, tutorial, design
Published: 2022-06-28 05:00:07

Learn how to implement neon effects using CSS, a technique for adding glowing to text.

To add a glow effect to the text, we need text-shadow property. The text-shadow property accepts a comma-separated list of shadows that applies to the text. Each shadow is described by some combination of X and Y offsets from the text, blur radius, and color.

`text-shadow: [x-offset] [y-offset] [blur-radius] [color];`

### Creating glow effect

First, we need to add a white glow to the outer edges of the text’s letters with a small blur radius. Next, we add the red glow by adding multiple shadows separated by a comma. We need all these shadows so that they can be stacked over one another to add more depth to the glow. To increase the size of the glow effect, we would increase the blur radius of shadows.

```css
.neon-text {
  text-shadow: 
    #FFFFFF 0 0 12px,
    #A91079 0 0 25px,
    #A91079 0 0 35px,
    #A91079 0 0 45px;
  text-align: center;
  font-size: 2.5rem;
  color: #fff;
}
```

### Adding the flickering effect

One thing you might notice about neon signs is that some of them — particularly older ones — tend to flicker. The light kind of goes in and out. We can do the same sort of thing with CSS animations.

To achieve that, we create a custom animation named neon using @keyframes. Then we move the shadows to the keyframe. The keyframe should apply and completely remove the shadows at chosen points during animation to create the flickering effect.

```css
@keyframes neon {
  0%, 18%, 22%, 25%, 53%, 57%, 100% {
    text-shadow: 
    #FFFFFF 0 0 12px,
    #A91079 0 0 25px,
    #A91079 0 0 35px,
    #A91079 0 0 45px;
  }

  20%, 24%, 55% {
    text-shadow: none;
  }
}
```

Finally, we call the animation where we want the light to flicker.

```css
.neon-text {
  animation: neon 3s infinite alternate;
  text-align: center;
  font-size: 2.5rem;
  color: #fff;
}
```

You can see the working animation and play with the final code at [nexuscode.online](https://nexuscode.online/editor/h4ptuG0VX3)

### Challenge your skills

Fork the code in the link above and experiment with various hues and colors as well as blur radius sizes, and don’t forget to try out different animations, too. Leave a comment if you’ve created a neat shadow effect you want to share.
Thanks for reading.
1689. Leetcode solution in Java
Tags: java
Published: 2022-06-28 04:59:46

```

class Solution 
{ 
public int minPartitions(String n)
 {
 char best = '0'; 
for (char c : n.toCharArray()) 
if (c > best) 
best = c; 
return best - '0'; 
} 
}

```
1647. Leetcode solution in Java
Tags: java
Published: 2022-06-28 04:58:34

`
class Solution { public int minDeletions(String s) { int[] counts = new int[26]; int length = s.length(); for (int i = 0; i < length; i++) counts[s.charAt(i) - 'a']++; List<Integer> countsList = new ArrayList<Integer>(); Set<Integer> countsSet = new HashSet<Integer>(); for (int i = 0; i < 26; i++) { if (counts[i] > 0) { countsList.add(counts[i]); countsSet.add(counts[i]); } } Collections.sort(countsList); int deletions = 0; int size = countsList.size(); int curCount = countsList.get(size - 1); for (int i = size - 2; i >= 0; i--) { int count = countsList.get(i); if (count == countsList.get(i + 1)) { curCount = Math.min(curCount, count - 1); while (curCount > 0 && countsSet.contains(curCount)) curCount--; countsSet.add(curCount); deletions += count - curCount; } } return deletions; } }



`
142. Leetcode solution in JavaScript
Tags: javascript
Published: 2022-06-28 04:57:53

`
var detectCycle = function(head) { let slow = head; let fast = head; while(fast && fast.next && fast.next.next){ slow = slow.next; // Move fast pointer twice as fast as slow pointer and if there is a cycle, the fast will eventually meet slow at a node in the cycle but not necessarily the node that starts the cycle fast = fast.next.next; // Once we determine there is a cycle we must find where the cycle starts if(slow === fast){ // Move slow pointer to the head slow = head; // Move both fast and slow pointer one node at a time and they will meet at the node where the cycle starts while(slow !== fast){ slow = slow.next; fast = fast.next; } return slow; } } return null; };


`
876. Leetcode solution in CPP
Tags: cpp
Published: 2022-06-28 04:57:12

```
class Solution {
 public:
  ListNode* middleNode(ListNode* head) {
    ListNode* slow = head;
    ListNode* fast = head;

    while (fast && fast->next) {
      slow = slow->next;
      fast = fast->next->next;
    }

    return slow;
  }
};

```
121. leetcode solution in JavaScript
Tags: javascript
Published: 2022-06-28 04:56:29

```
var maxProfit = function(prices) { 
let profit = 0 
let min = prices[0]
 for(let i = 1; i < prices.length; i++){ 
// The day we should buy at min = Math.min(min, prices[i-1]) 
// Check if selling at the current day gives us the most profit 
profit = Math.max(prices[i]-min, profit)
 } 
return profit 
};


```
409 leetcode solution in CPP
Tags: cpp
Published: 2022-06-28 04:54:42

```

class Solution {
 public:
  int longestPalindrome(string s) {
    int ans = 0;
    vector<int> count(128);

    for (const char c : s)
      ++count[c];

    for (const int c : count)
      ans += c % 2 == 0 ? c : c - 1;

    const bool hasOddCount =
        any_of(begin(count), end(count), [](int c) { return c & 1; });

    return ans + hasOddCount;
  }
};


```
Personal Environment Variables
Published: 2022-06-28 04:46:50


### Use

An environment variable is a dynamic "object" on a computer, which refers to the system checking some protocols like where to find the particular program, where to save the temporary files and many more. We set up some environment variables while installing the interpreter or compiler for any language like Java, C++, etc. Generally, it is denoted as $PATH(UNIX & LINUX) or PATH(Windows). The cool part of environment variables is we can make our own like any other programming variables and set some values to them. We can do some automation and some really cool stuff.

### Benefits
-  Easy to use.
-     It increases efficiency.

### Example

If you are working on a project, where you are writing some python automation script and using some specific folder to create logs, save and move the modified file from one directory to another. So, you can set some environment variables for the same and use them in your script.

### How to Make it:

```
export ORA=$ORA /mnt/c/Users/Admin/Oracle
```

This will set a variable _$ORA _with the value - `/mnt/c/Users/Admin/Oracle`

### How to check the value:

```
echo $ORA
```

This will print the value of the $ORA which is `/mnt/c/Users/Admin/Oracle`

### How to use it:

```
cd $ORA
```

cd is known as change directory, so the above command changes the directory to its value(your desired path) and goes to the Oracle folder.

### How to delete it:

```
export ORA=${ORA% /mnt/c/Users/Admin/Oracle}
```

The above command will delete the value from the variable. I have put this command just because I messed up a big-time and I had to research out how to revert back or change the variable values.

So, this is it from my end till now on this topic. If you want to add something please feel free to share. If I got some more updates then I will update the article. Thanks for reading and enjoy my write-up.
Real Users, Real clients and MVP project development.
Tags: beginners, discuss
Published: 2022-06-28 04:42:13

The most important thing I learned about this phase is how important is to have a good communication, teamwork and time management. 

### The role of communication when building a project

When I started working on my first project that includes a real client we scheduled a weekly meeting to show a demo of what we’ve been working on the week. We started asking questions and the client ask us for more features, on our firsts times we can get scared and started saying yes to all.

But it is important to identify how many time we have and how to manage it, as developers we now that a bug can takes us hours to solve. But working on teams show me that it’s important to communicate, talk about  the progress of the tasks, identify any blockers and ask for help. 

### What it’s possible and what isn’t

From the beginning of the project we knew that all has to be done in 4 weeks, set goals and deadlines is going to help us identify what tasks are possible to achieve and which not. 

When we are working with a client knowing that our project is going to be used by real users we have to discuss about deliverables and negotiate deadlines in order to build a good project.
INSTALL DOCKER
Tags: javascript, docker, mysql, linux
Published: 2022-06-28 04:41:10

1. Actualizar

`sudo apt update`
2. LINK:

`sudo apt install apt-transport-https ca-certificates curl software-properties-common
`
3. LINK:

`curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
`
4. LINK

`sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu focal stable"`

5. LINK

` sudo apt install docker-ce`

6. LINK: VER el estado

`sudo systemctl status docker`
7.Version
`docker version`
8. descarga alguna imagen

`docker pull image(example: mysql)
docker images (listar imagenes ISO)`
9. LINK 

`docker run -d -p 33060:3306 --name mysql-db -e MYSQL_ROOT_PASSWORD=secret mysql`
10. Para ver que puertos esta corriendo

`sudo docker ps -a
`
11. Mstrar contenedores

`sudo docker container ls -a
`
12 correr contenedores:

` docker exec -it mysql-db mysql -p`

13. ELiminaer contenedor docker
`sudo docker rm 4e(CONTAINER_ID)`

https://platzi.com/tutoriales/1432-docker/3268-como-crear-un-contenedor-con-docker-mysql-y-persistir-la-informacion/

14. `sudo docker inspect CONTAINER_ID`

OJO: 
Para usuarios de DBeaver :

Haga clic derecho en su conexión, elija "Editar conexión"

En la pantalla "Configuración de conexión" (pantalla principal) haga clic en "Editar configuración del controlador"

Haga clic en "Propiedades de conexión"

Haga clic derecho en el área de "propiedades de usuario" y elija "Agregar nueva propiedad"

Agregue dos propiedades: "useSSL" y "allowPublicKeyRetrieval"

Establezca sus valores en "falso" y "verdadero" haciendo doble clic en la columna "valor"

---DOCKER POSTGRESS
-docker pull postgress
-docker images (para ver imagenes)
-sudo docker run -d -p 54320:5432 --name postgres-db -e POSTGRES_PASSWORD=secret postgres
-sudo docker exec -it postgres-db psql -U postgres
-ahora crear dbs
CADA VEZ QUE QUIERES  ARRANCAR EL DEMONIO CUANDO YA ESTAB CREADO LOS PUERTOS
sudo docker start d8
sudo stop start d8(iniciales de container ID)
Building V 1.0 of our project and making the deploy.
Tags: beginners, tutorial, programming, codenewbie
Published: 2022-06-28 04:23:33

On the previous weeks we’ve been working on building a project from scratch in 4 weeks implementing agile methodologies and working with weekly sprints. In this week we’re going to be working on the deployment and de V 1.0 of the project. 

What we need to know is that the first version of a project also known as MVP is designed to be working with the basic features and it’s not designed to be implemented in real life there are many filters to pass by before using it on real life. 

## What is a deployment?

When setting up a project you will always have your live project, which is called the development environment or production environment. The deploy is a version of our project build for production refers to the process of running our application on a server or a device. 

Before we work on making a deploy we need to test and verify if the project is functional and check if  has no errors.

## Free sites to deploy our app

- [Heroku](https://www.heroku.com/)
    - Heroku is a cloud application platform that supports most programming languages, including the likes of Go, Node.js, Clojure, and more.
- [Vercel](https://vercel.com/)
    - Vercel is a revolutionary serverless deployment service designed for React, Angular, Vue, and other JavaScript libraries.
- [Netlify](https://www.netlify.com/)
    - Netlify is one of the most popular services out there for web deployment. It easily imports projects from GitHub, GitLab, and Bitbucket, and is widely used with [Jamstack](https://blog.logrocket.com/why-you-should-be-using-jamstack/) applications.
- [Github pages](https://pages.github.com/)
    - GitHub Pages is one of the fastest and most widely-used methods for beginners to deploy websites. With [GitHub Actions](https://github.com/marketplace?type=actions) you can trigger automatic deployments, [configure CI/CD](https://blog.logrocket.com/ci-cd-node-js-github-actions/) and much more.

## What I’ve learn in this 4 Weeks of development

It’s important to identify the basics steps when you start a new project. We can take this 4 weeks as a path to follow and continue developing our project, implementing this will help us to identify client needs on a better and easiest way. 

Keep tracking our progress and working with weekly sprints isgoing to help us achieve goals and work faster. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/h8w1mebej288sxnyg39g.png)
Opportunity for BlockChain enthusiasts to win cash prizes upto $100K!
Published: 2022-06-28 04:19:06

Link to apply: https://bit.ly/3A6Em5Z

TezAsia Hackathon is a month-long hackathon organised by Tezos India and Tezos APAC with the goal of promoting and making Tezos blockchain more accessible to the general public. 

This is a chance for all Dev-Heads who are with a competitive streak to showcase their tier one game and also get a chance to win hefty cash prizes. TezAsia Hackathon aims to build an innovation-driven culture by solving real-world challenges. Showcase your skills at our hackathon and win amazing prizes worth $100k+, grants up to $100k+ and an opportunity to get hired and work with the best-existing dapps & Tezos entities in the ecosystem.

This hackathon is open to ALL - newcomers, advanced coders, students, working professionals, blockchain enthusiasts, and others.

Apply here: https://bit.ly/3A6Em5Z
Did you ever have to appear for an interview underprepared?
Tags: hiring, career, webdev, beginners
Published: 2022-06-28 04:16:39

I remember feeling nervous every time I had an interview. I was always confused about what should I prepare for? Have I prepared enough?

Now I see this frequently with candidates from the other side as a recruiter. Candidates show up underprepared for their technical interviews and complain they just didn't get enough time.

At UpSkillie we often find good candidates losing an opportunity due to under-preparedness. Sometimes we try to give them a second chance, if we feel they can do better next time.

But you don't always get second chances. Right?

Let me narrate a relatable phone conversation:

HR: Hey, your profile has been shortlisted for the technical round. Our interviewer is available at coming Friday at 5 PM. Can I schedule it for you?

You: Ummm Okay.

HR: Are you sure?

You: Yes! (back in the mind you are just thinking it’s too early)

HR: You’ll receive an invite with further information. Good Luck. Have a good day!

You: Yep. Thanks

The story can also go like this:

You: Hi! I wanted to discuss the interview scheduled for Friday.

HR: Yes, please say?

You: Thank you for the opportunity. I am interested to go forward but I will need some time to prepare. I want to give this my best shot.

I don’t want to take a chance here and regret it later. Could you please be kind to postpone the interview?

HR: I made sure to check with you before any confirmation on the timelines. It’s difficult to shift the dates but since I see you are really keen to give this your best shot, I shall do the needful. Please let me know if Tuesday next week would be enough time to prepare?

Candidate: Yes, that would be really helpful. Thanks for understanding.


As you can see, your communication about your need to prepare and earnestness towards the opportunity, can get you the space you'd need to perform at the best.

You need not be reserved about expressing your concerns, and getting dragged into an unprepared interview.

Often all you need to do, is to speak up! A recruiter understand your needs, they are also rooting for your success.

Once you do get the schedule to your liking make sure to show up on time and prepared to your best.

However, don’t consider rescheduling as the option to procrastinate or drag the process. Requesting for a reschedule should be the last resort.
memoapp.pro | Made with Backbone JS
Published: 2022-06-28 04:16:28

![memoapp.pro | Made with Javascript | Backbone JS](https://res.cloudinary.com/madewithjavascript/image/upload/v1655736685/large_memoapp_pro_made_with_backbone_js_381fabc4af.jpg "memoapp.pro | Made with Javascript | Backbone JS")


### Learn Spanish with memes

> Memo helps you acquire a language by having fun.
> 1️⃣ Translate memes of various difficulty levels
> 2️⃣ Learn tricky slang phrases
> 3️⃣ Repeat new words and add yours
> Bravo 👏🏻 Now you are acquainted with culture nuances as well as colloquial language
> 
> 

## Check out more such amazing projects on our website

[Made with Javascript](https://madewithjavascript.club)

## Want us to feature your project

[Submit your Project to Made with Javascript](https://madewithjavascript.club/submit-project)


You can also write to us for any of your queries at:

[Email Made with Javascript](mailto:madewithjavascript@gmail.com)

## Project already shared on our social media handles.

| SocialMedia | SharedLink |
| ----------- | ---------- |
| Twitter | [memoapp.pro on Twitter](https://twitter.com/withjavascript/status/1541635014227542017?s=20&t=CAkZGwmzJriQENNWY_6zIQ)
 |
| Medium | [memoapp.pro on Medium](https://medium.com/@madewithjavascript/memoapp-pro-made-with-backbone-js-d455ee7d0b1d)
 |
| Facebook | [memoapp.pro on Facebook](https://www.facebook.com/madewithjavascript/posts/pfbid0NcGNiz5TAXjd4dszAtuijPjYCnGZXJNz6vdz1xByx9jh2bGNkE5ixENLZPadBECdl)
 |
| Tumblr | [memoapp.pro on Tumblr](https://www.tumblr.com/blog/view/madewithjavascript/688274259387334656?source=share)
 |
| LinkedIn | [memoapp.pro on LinkedIn](https://www.linkedin.com/feed/update/urn:li:activity:6947400854308044800)
 |
| Pinterest | [memoapp.pro on Pinterest](https://pin.it/pNKI6VM)
 |


Filled Under:


 - [Made with Javascript](https://madewithjavascript.club)
 - [Made with Backbone JS](https://madewithjavascript.club/categories/backbone-js)

Make sure to give this post ❤ 50 ❤ hearts, click the 🦄 unicorns 🦄 and follow 👉 @madewithjavascript 👈 for more such awesome showcases. Show you love for the people who have worked so hard!