This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mongo = require('mongodb'); | |
const chalk = require('chalk'); | |
const url = "mongodb://localhost:27017/codeforgeek"; | |
const async = require('async'); | |
const request = require('request'); | |
// start the work | |
mongo.connect(url, {useNewUrlParser: true}, (err, db) => { | |
if(err) { | |
console.log(err); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const arDrone = require('ar-drone'); | |
var drone = arDrone.createClient(); | |
// disable emergency | |
drone.disableEmergency(); | |
// take off the drone | |
drone.takeoff(); | |
// take drone half meter up | |
drone.up(0.2); | |
setTimeout(() => { | |
drone.stop(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
var SpeechRecognition = window.SpeechRecognition || window.webkitSpeechRecognition; | |
var recognition = new SpeechRecognition(); | |
} | |
catch(e) { | |
console.error(e); | |
$('.no-browser-support').show(); | |
$('.app').hide(); | |
} | |
// other code, please refer GitHub source |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>Voice Controlled Notes App</title> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/shoelace-css/1.0.0-beta16/shoelace.css"> | |
<link rel="stylesheet" href="styles.css"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const bodyparser = require('body-parser'); | |
var arDrone = require('ar-drone'); | |
const router = express.Router(); | |
const app = express(); | |
const commands = ['takeoff', 'land','up','down','goleft','goright','turn','goforward','gobackward','stop']; | |
var drone = arDrone.createClient(); | |
// disable emergency | |
drone.disableEmergency(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const app = express(); | |
const path = require('path'); | |
const router = express.Router(); | |
router.get('/',function(req,res){ | |
res.sendFile(path.join(__dirname+'/index.html')); | |
//__dirname : It will resolve to your project folder. | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const express = require('express'); | |
const app = express(); | |
const path = require('path'); | |
const router = express.Router(); | |
router.get('/',function(req,res){ | |
res.sendFile(path.join(__dirname+'/index.html')); | |
//__dirname : It will resolve to your project folder. | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<head> | |
<title>Express HTML</title> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css"> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap-theme.min.css"> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script> | |
</head> | |
<body> | |
<div style="margin:100px;"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* NodeJS beefree.io integration | |
*/ | |
const https = require('https'); | |
const querystring = require('querystring'); | |
/** | |
* Fetch access token from beefree api | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Go to DigitalOcean and <a href="https://m.do.co/c/31513addbd1b" target="_blank">login</a> to your account, create one if not already. | |
Create new Droplet ( Server ) and choose latest Ubuntu. Refer the image below for reference. | |
<img src="https://codeforgeek.com/wp-content/uploads/2016/12/dropet-1024x517.gif" alt="digitalocean droplet" width="640" height="323" class="aligncenter size-large wp-image-2763" /> | |
DigitalOcean will create new Droplet and send you an e-mail containing the credentials to log-in your Server. You can use <strong>SSH</strong> or putty ( For Windows User ) to login to your Server. | |
Once you are logged on, do the system update first using the following command. |
NewerOlder