VOOZH about

URL: https://gist.github.com/prashanta

⇱ prashanta’s gists Β· GitHub


Skip to content
Sign in Sign up

Instantly share code, notes, and snippets.

πŸ‘ View prashanta's full-sized avatar
πŸš€
Building Intelligent, Connected Industries.

Prashanta Shrestha prashanta

πŸš€
Building Intelligent, Connected Industries.
πŸ’₯ I love moving electrons. IIoT, Industry 4.0, PLC/PACs, RPi, Arduino, NodeMCU, Data Viz
View GitHub Profile
/**
* Prgram to test async.queue usage
* - gerenates tasks at the rate of "taskGenRate"
* - tasks are proocessed at the rate of "taskProcessRate"
* - process is paused when queue size reaches "maxQueueSize"
*/
const async = require('async');
let i = 0;
/**
* Prgram to test async.queue usage
* - gerenates tasks at the rate of "taskGenRate"
* - tasks are proocessed at the rate of "taskProcessRate"
* - process is paused when queue size reaches "maxQueueSize"
*/
const async = require('async');
let i = 0;
prashanta / .gitignore
Last active
Filtered Exception Catching in Bluebird Promise
node_modules

Some reoccurring git commands

  • Graphical git log

    git log --graph --oneline --decorate

  • Difference between local file and remote

    git diff origin/master path/to/file.ext

prashanta / default.js
Last active
Reusing ES6 React Component on Server Side (yup, node.js does not support ES6 yet, so this is a hack using Babel)
var express = require('express');
var router = express.Router();
var babel = require("babel-core");
var React = require('react');
// Get ReactDOMServer for server side rendering
var ReactDOMServer = require('react-dom/server');
// Compile code transformed by babel.transformFileSysnc
module._compile(babel.transformFileSync('./public/js/components/header.js').code);
// Save it to a accessible header before moudle.exports gets replaaced

Common Linux Commands

Contained here are trival stuffs. Like with all trival stuffs, its inevitably bound to be forgotten.

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
html { height: 100% }
body { height: 100%; margin: 0; padding: 0 }
#map_canvas {
position: absolute;
width: 100%;
prashanta / SerialRelay.ino
Created
Data relay between two USARTs of an Arduino
#include <SoftwareSerial.h>
SoftwareSerial mySerial = SoftwareSerial(10, 11);; // RX, TX
void setup() {
pinMode(10,INPUT);
pinMode(11,OUTPIT);
mySerial.begin(19200);// this connects to the other USART device
Serial.begin(19200); // this one connects to a computer via USB
while (!Serial) {
javascript:(function(){%20window.open('http://talkgadget.google.com/talkgadget/popout','myWindow',%20'status=1,%20height=600,width=400,resizable%20=%200,location=0');%20})();
NewerOlder
You can’t perform that action at this time.