Skip to content

Instantly share code, notes, and snippets.

View r4hulp's full-sized avatar
🎯
Focusing

Rahul P r4hulp

🎯
Focusing
View GitHub Profile
@r4hulp
r4hulp / install-jekyll-chocolatey.ps
Created May 29, 2017 15:40
Install Jekyll using Chocolatey
choco install ruby -y
gem install bundler
gem install jekyll
@r4hulp
r4hulp / Jekyll-to-Github.bat
Created June 9, 2017 15:06
Jekyll to Github repo.
git init
git add .
git commit -m "First commit"
git remote add origin {remote_repository_url}
git remote -v
git push origin master
@r4hulp
r4hulp / install-firebase-tools.bat
Created June 9, 2017 15:13
Install Firebase tools
npm install -g firebase-tools
@r4hulp
r4hulp / firebase-login.bat
Created June 9, 2017 15:27
Firebase login
firebase login
@r4hulp
r4hulp / firebase.json
Created June 9, 2017 15:41
Firebase configuration
{
"hosting": {
"public": "_site",
"rewrites": [
{
"source": "**",
"destination": "/index.html"
}
]
}
@r4hulp
r4hulp / travis.yml
Last active June 29, 2018 11:32
Travis Build Script for Jekyll and Firebase
#use node_js
language: node_js
#define node js version to use
node_js:
- "7"
#choose branch on commit of which this script should excecute
branches:
only:
@r4hulp
r4hulp / add-travis-to-git-repo.bat
Created June 9, 2017 17:16
Adding Travis.yml to repository
git add .
git commit -m "added travis.yml"
git push origin master
@r4hulp
r4hulp / Global.asax.cs
Created December 29, 2017 07:33
Registering module
//In Global.asax.cs
builder.RegisterModule(new AzureModule(Assembly.GetExecutingAssembly()));
var store = new TableBotDataStore(ConfigurationManager.ConnectionStrings["StorageConnectionString"].ConnectionString);
builder.Register(c => store)
.Keyed<IBotDataStore<BotData>>(AzureModule.Key_DataStore)
.AsSelf()
.SingleInstance();
@r4hulp
r4hulp / AnyDialog.cs
Last active December 29, 2017 07:36
Resolve DataStore scope
//In your dialog
Activity message = result as Activity;
//Create scope with respect to activity
using (var scope = DialogModule.BeginLifetimeScope(Conversation.Container, message))
{
//Resolve scope for IBotDataStore<BotData>
IBotDataStore<BotData> stateStore = scope.Resolve<IBotDataStore<BotData>>();
}
@r4hulp
r4hulp / AnyDialog.cs
Created December 29, 2017 07:47
Retrieve user data
//In your dialog
Activity message = result as Activity;
//Create scope with respect to activity
using (var scope = DialogModule.BeginLifetimeScope(Conversation.Container, message))
{
//Resolve scope for IBotDataStore<BotData>
IBotDataStore<BotData> stateStore = scope.Resolve<IBotDataStore<BotData>>();
/* Retrieve user address. Address key holds information about Bot, Channel, User and conversation */