Skip to content

Commit 38b5aec

Browse files
committed
Complete Project 🐧 🍎 💩
1 parent 55a7f9e commit 38b5aec

8 files changed

+194
-0
lines changed

.editorconfig

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
root = true
2+
3+
[*]
4+
indent_style = tab
5+
end_of_line = lf
6+
charset = utf-8
7+
trim_trailing_whitespace = true
8+
insert_final_newline = true
9+
10+
[{package.json,*.yml}]
11+
indent_style = space
12+
indent_size = 2

.gitattributes

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
* text=auto
2+
*.js text eol=lf

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
node_modules
2+
dist

.travis.yml

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
sudo: false
2+
language: node_js
3+
node_js:
4+
- '6'
5+
- '4'

CONTRIBUTING.md

+93
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
2+
# Contributing
3+
4+
When contributing to this repository, please first discuss the change you wish to make via issue,
5+
email, or any other method with the owners of this repository before making a change.
6+
7+
Please note we have a code of conduct, please follow it in all your interactions with the project.
8+
9+
## Pull Request Process
10+
11+
1. Ensure any install or build dependencies are removed before the end of the layer when doing a
12+
build.
13+
2. Update the README.md with details of changes to the interface, this includes new environment
14+
variables, exposed ports, useful file locations and container parameters.
15+
3. Increase the version numbers in any examples files and the README.md to the new version that this
16+
Pull Request would represent. The versioning scheme we use is [SemVer](http://semver.org/).
17+
4. You may merge the Pull Request in once you have the sign-off of two other developers, or if you
18+
do not have permission to do that, you may request the second reviewer to merge it for you.
19+
20+
## Code of Conduct
21+
22+
### Our Pledge
23+
24+
In the interest of fostering an open and welcoming environment, we as
25+
contributors and maintainers pledge to making participation in our project and
26+
our community a harassment-free experience for everyone, regardless of age, body
27+
size, disability, ethnicity, gender identity and expression, level of experience,
28+
nationality, personal appearance, race, religion, or sexual identity and
29+
orientation.
30+
31+
### Our Standards
32+
33+
Examples of behavior that contributes to creating a positive environment
34+
include:
35+
36+
* Using welcoming and inclusive language
37+
* Being respectful of differing viewpoints and experiences
38+
* Gracefully accepting constructive criticism
39+
* Focusing on what is best for the community
40+
* Showing empathy towards other community members
41+
42+
Examples of unacceptable behavior by participants include:
43+
44+
* The use of sexualized language or imagery and unwelcome sexual attention or
45+
advances
46+
* Trolling, insulting/derogatory comments, and personal or political attacks
47+
* Public or private harassment
48+
* Publishing others' private information, such as a physical or electronic
49+
address, without explicit permission
50+
* Other conduct which could reasonably be considered inappropriate in a
51+
professional setting
52+
53+
### Our Responsibilities
54+
55+
Project maintainers are responsible for clarifying the standards of acceptable
56+
behavior and are expected to take appropriate and fair corrective action in
57+
response to any instances of unacceptable behavior.
58+
59+
Project maintainers have the right and responsibility to remove, edit, or
60+
reject comments, commits, code, wiki edits, issues, and other contributions
61+
that are not aligned to this Code of Conduct, or to ban temporarily or
62+
permanently any contributor for other behaviors that they deem inappropriate,
63+
threatening, offensive, or harmful.
64+
65+
### Scope
66+
67+
This Code of Conduct applies both within project spaces and in public spaces
68+
when an individual is representing the project or its community. Examples of
69+
representing a project or community include using an official project e-mail
70+
address, posting via an official social media account, or acting as an appointed
71+
representative at an online or offline event. Representation of a project may be
72+
further defined and clarified by project maintainers.
73+
74+
### Enforcement
75+
76+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
77+
reported by contacting the project team at [[email protected]]. All
78+
complaints will be reviewed and investigated and will result in a response that
79+
is deemed necessary and appropriate to the circumstances. The project team is
80+
obligated to maintain confidentiality with regard to the reporter of an incident.
81+
Further details of specific enforcement policies may be posted separately.
82+
83+
Project maintainers who do not follow or enforce the Code of Conduct in good
84+
faith may face temporary or permanent repercussions as determined by other
85+
members of the project's leadership.
86+
87+
### Attribution
88+
89+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
90+
available at [http://contributor-covenant.org/version/1/4][version]
91+
92+
[homepage]: http://contributor-covenant.org
93+
[version]: http://contributor-covenant.org/version/1/4/

LICENSE.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) [Akshay Kadam](http://github.com/deadcoder0904) <<[email protected]>>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

package.json

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
{
2+
"name": "nodejs",
3+
"version": "1.0.0",
4+
"description": "Desktop Notifier to ensure you keep drinking water every 2 hours",
5+
"main": "thirsty.js",
6+
"scripts": {
7+
"start": "pm2 start thirsty.js",
8+
"startup": "pm2 startup",
9+
"delete": "pm2 delete thirsty.js"
10+
},
11+
"author": "Akshay Kadam <[email protected]> (http://deadcoder0904.github.io/)",
12+
"license": "MIT",
13+
"dependencies": {
14+
"is-linux": "^1.0.1",
15+
"node-notifier": "^5.1.2",
16+
"node-schedule": "^1.2.1",
17+
"pm2": "^2.4.6"
18+
},
19+
"devDependencies": {}
20+
}

thirsty.js

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
var schedule = require('node-schedule');
2+
var notifier = require('node-notifier');
3+
var isLinux = require('is-linux');
4+
5+
var j = schedule.scheduleJob('* */2 * * *', function(){
6+
if(isLinux()) {
7+
notifier.notify(
8+
{
9+
title: 'DRINK WATER',
10+
message: 'Its time to Drink Water 🍹'
11+
}
12+
);
13+
return;
14+
}
15+
var trueAnswer = 'Yes !';
16+
notifier.notify(
17+
{
18+
title: 'DRINK WATER',
19+
message: 'Did you Drink Water 🍹 ?',
20+
actions: trueAnswer
21+
},
22+
function(err, response,metadata) {
23+
if (err) throw err;
24+
25+
if (metadata.activationValue !== trueAnswer) {
26+
notifier.notify({
27+
'title': 'DRINK WATER',
28+
'message': 'Then let\'s code, Champ 😉 !!'
29+
});
30+
}
31+
else {
32+
notifier.notify({
33+
'title': 'DRINK WATER',
34+
'message': 'Please drink water now or you\'ll get dehydrated 🚑 '
35+
});
36+
}
37+
}
38+
);
39+
});

0 commit comments

Comments
 (0)