Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Vinay Pandya imVinayPandya

🏠
Working from home
View GitHub Profile
@imVinayPandya
imVinayPandya / accountInformationSyncer.js
Last active Sep 25, 2019
How to get notification when CRON fails (Node.js).
View accountInformationSyncer.js
// Main cron's logic here which will return array of messages
// and it will tell, how i am returning partially/full success result from this function
const accountInformationSyncer = ({ logger, utils, userUtils, interactiveBrokers }) => async () => {
const messages = []; // Array of result
const unexpectedErrors = []; // array of unexpectedErrors
function logInfo(msg) {
const m = `Account information sync: ${msg}`;
logger.info(m); // this will log to console/file
messages.push(m); // this will push message in array
View login.component.html
<div *tdLoading="'overlayStarSyntax'; mode:'indeterminate'; type:'circular'; strategy:'overlay'; color:'accent'">
<div layout="column" layout-fill>
<md-toolbar color="primary" class="md-whiteframe-z1">
<span>Login</span>
</md-toolbar>
<div class="md-content" layout-padding flex>
<div layout-gt-xs="row" layout-align-gt-xs="center start" class="margin">
<div flex-gt-xs="50">
@imVinayPandya
imVinayPandya / stream.sh
Created Jan 11, 2017 — forked from dstoc/stream.sh
Streaming h264 rtsp to youtube
View stream.sh
ffmpeg -i rtsp://${SOURCE} -vcodec copy -f flv\
-acodec libmp3lame -ar 44100 -threads 6 -qscale 3 -b:a 712000 -bufsize 512k\
rtmp://a.rtmp.youtube.com/live2/${KEY}
@imVinayPandya
imVinayPandya / feed.sh
Created Jan 11, 2017 — forked from dstoc/feed.sh
Feed rtsp to ffserver as webm via mpegts
View feed.sh
ffmpeg -i rtsp://${SOURCE} -vcodec copy -f mpegts -\
| ffmpeg -i pipe:0 -crf 10 -b:v 2M -c:v libvpx -g 25 http://${TARGET}
View index.js
var alexa = require('alexa-traffic-rank'),//including alexa traffic rank node js module to get data from alexa.com
mongoose = require('mongoose'); // including mongoose node js module to connect MongoDB
mongoose.connect('mongodb://localhost:27017/test'); // this url should be your mongoDB url
var db = mongoose.connection, // Database connection object
schema = mongoose.Schema({}, {collection: 'AlexaDailyTracks', strict: false, versionKey: false}); // Defining MongoDB Schema
// this code run if you fail to connect database
db.on('error', function(error) {
View Thumbnail-List:-1.0.0-beta.9.markdown