Skip to content

Instantly share code, notes, and snippets.

View shaikh-shahid's full-sized avatar
🌎
Building Decentralized Web

Shahid Shaikh shaikh-shahid

🌎
Building Decentralized Web
View GitHub Profile
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);
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();
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
<!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">
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();
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.
});
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.
});
<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;">
@shaikh-shahid
shaikh-shahid / beefree.js
Created March 30, 2017 11:20 — forked from andrei-tofan/beefree.js
Fetch access token from beefree api
/**
* NodeJS beefree.io integration
*/
const https = require('https');
const querystring = require('querystring');
/**
* Fetch access token from beefree api
*/
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.