Skip to content

Instantly share code, notes, and snippets.

Shahid Shaikh codeforgeek

Block or report user

Report or block codeforgeek

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View wp-to-mongo.js
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);
View drone.js
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();
View script.js
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
View index.html
<!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">
View voice.js
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();
View app2.js
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.
});
View app.js
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.
});
View index.html
<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;">
@codeforgeek
codeforgeek / beefree.js
Created Mar 30, 2017 — forked from andrei-tofan/beefree.js
Fetch access token from beefree api
View beefree.js
/**
* NodeJS beefree.io integration
*/
const https = require('https');
const querystring = require('querystring');
/**
* Fetch access token from beefree api
*/
View Installing ElasticSearch on DigitalOcean.html
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.
You can’t perform that action at this time.