Skip to content

Instantly share code, notes, and snippets.

View slvnperron's full-sized avatar

Sylvain Perron slvnperron

View GitHub Profile
@slvnperron
slvnperron / content.yml
Created May 24, 2017 23:33
This is an example of how to build a form in Botpress using three different ways
misunderstand:
- I don't understand this.
done:
- 🎈
- We're all done then :)
ask_gender:
- text: What is your gender?
quick_replies:
@slvnperron
slvnperron / keybase.md
Last active December 7, 2017 16:44
keybase.md

Keybase proof

I hereby claim:

  • I am slvnperron on github.
  • I am slvn (https://keybase.io/slvn) on keybase.
  • I have a public key whose fingerprint is 8DD9 9A84 62BE 0FA9 06E6 CB74 7824 BCA4 9603 A72F

To claim this, I am signing this object:

@slvnperron
slvnperron / actions.js
Created January 16, 2019 20:47
Haytham jumpTo (bp 10)
/**
* Description of the action goes here
* @param {String} params.name=value Description of the parameter goes here
* @param {Number} [params.age] Optional parameter
*/
async function yourCustomAction(state, event, params) {
return state;
}
/**
@slvnperron
slvnperron / suggestion_chips.js
Created April 25, 2019 15:44
Outgoing Middleware
const _ = require('lodash')
/**
* This outgoing middleware will find the $"..." pattern in the ougoing text
* And transform those into suggestion chips in channel-web
* @example e.g.
* `What type of restaurant are you looking for? $“Asian” $”Mexican” $”American”`
*/
const regex = /\$(“|'|"|”)([\w\s]+)(“|'|"|”)/g
@slvnperron
slvnperron / UBUNTU-DOCKER-ENTERPRISE-README.sh
Last active April 14, 2021 17:11
Installing Botpress on vanilla Ubuntu
# Ubuntu 18.04
# Step 1. Installing Docker
# -------------------------
# Reference: https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-18-04
sudo apt update && \
sudo apt install apt-transport-https ca-certificates curl software-properties-common -y && \
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - && \
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" && \
@slvnperron
slvnperron / webchat.css
Created October 24, 2019 18:27
CSS Webchat
.bpw-button, .bpw-button-alt {
height: unset;
min-height: 40px;
}
@import url('https://fonts.googleapis.com/css?family=Roboto:400,500&display=swap');
.bpw-layout {
font-family: 'Roboto', sans-serif !important;
}
.bpw-from-bot .bpw-chat-bubble .bpw-chat-bubble-content {
background-color: #ececec !important;
}
@slvnperron
slvnperron / table-domain.ts
Created October 22, 2024 01:30
Botpress Table Domain Extractor
// The Table we want to analyze
const Table: FromagesTable = FromagesTable
const TableName = 'FromagesTable'
// List of columns we want to analyze the unique values and count of
const columns: Array<keyof Awaited<ReturnType<Table['getRecord']>>> = [
'alcools',
'familles',
'flaveurs',
'fromageries',