Skip to content

Instantly share code, notes, and snippets.

View srichakradhar's full-sized avatar

Srichakradhar Reddy Nagireddy srichakradhar

View GitHub Profile
@srichakradhar
srichakradhar / BingSpeechWebchatV3.html
Created May 28, 2019 10:05
Bing Speech Webchat v3
<script src="https://cdn.botframework.com/botframework-webchat/latest/botchat.js"></script>
<script src="https://cdn.botframework.com/botframework-webchat/latest/CognitiveServices.js"></script>
<script>
const speechOptions = {
speechRecognizer: new CognitiveServices.SpeechRecognizer({ subscriptionKey: 'ab72b342baa54b1abcb45cce477f705a' }),
speechSynthesizer: new CognitiveServices.SpeechSynthesizer({
gender: CognitiveServices.SynthesisGender.Female,
subscriptionKey: 'ab72b342baa54b1abcb45cce477f705a',
voiceName: 'Microsoft Server Speech Text to Speech Voice (en-US, JessaRUS)'
})
@srichakradhar
srichakradhar / spaceDoggos.sol
Created September 22, 2018 05:59
Contract in solidity - Space Doggos by BitDegree
pragma solidity ^0.4.20;
contract SpaceDoggos {
uint maxPlanetsPerSystem = 10;
uint minPlanetsPerSystem = 3;
uint planetCodeDigits = 7;
uint systemCodeDigits = 7;
@srichakradhar
srichakradhar / app_insights.js
Created September 10, 2018 12:24
Azure App Insights Setup
// https://docs.microsoft.com/en-us/azure/application-insights/app-insights-nodejs
const appInsights = require("applicationinsights");
appInsights.setup("<instrumentation_key>")
.setAutoDependencyCorrelation(true)
.setAutoCollectRequests(true)
.setAutoCollectPerformance(true)
.setAutoCollectExceptions(true)
.setAutoCollectDependencies(true)
.setAutoCollectConsole(true)
@srichakradhar
srichakradhar / merge_mp4.sh
Created August 8, 2018 18:06
concatenate two videos (no audio)
ffmpeg -i video1.avi -i video2.gif -filter_complex "[0:v:0] [1:v:0] concat=n=2:v=1 [v]" -map "[v]" output.mp4
# source: https://www.bugcodemaster.com/article/concatenate-videos-using-ffmpeg
@srichakradhar
srichakradhar / connect to jenkins
Created July 8, 2018 09:25
jenkins_connect.sh
putty -ssh -L 127.0.0.1:8080:localhost:8080 tcs@tcs.southindia.cloudapp.azure.com
ffmpeg -i source.mp4 -c:v wmv2 -b:v 1024k -c:a wmav2 -b:a 192k target.wmv
ffmpeg -i source.mp4 -ss 00:00:00 -t 00:01:57 -vcodec copy -acodec copy cut.mp4
var msg = new builder.Message(session)
.text(response)
.suggestedActions(builder.SuggestedActions.create(session, [
builder.CardAction.postBack(session, "thumbs-up", "👍"),
builder.CardAction.postBack(session, "thumbs-down", "👎"),
]));
// Option 1: No speech
//
// const speechOptions = null;
// // Option 2: Native browser speech (not supported by all browsers, no speech recognition priming support)
//
// Note that Chrome automatically blocks speech if the HTML file is loaded from disk. You can run a server locally
// or launch Chrome (close all the existing Chrome browsers) with the following option:
// chrome.exe --allow-file-access-from-files <sampleHtmlFile>
//
@srichakradhar
srichakradhar / botGoBack.js
Last active March 7, 2018 15:53
To go back a step in a waterfall dialog if the user entered wrong data
next({ resumed: builder.ResumeReason.back })
// use https://docs.botframework.com/en-us/node/builder/chat-reference/classes/_botbuilder_d_.dialogaction.html#validatedprompt
// https://docs.botframework.com/en-us/node/builder/chat-reference/classes/_botbuilder_d_.dialogaction.html