Skip to content

Instantly share code, notes, and snippets.

View david-wb's full-sized avatar

David Brown david-wb

  • Lyon, France
  • 09:31 (UTC +02:00)
View GitHub Profile
@david-wb
david-wb / gist:162de776afd919989e39026c4d15858e
Last active April 11, 2025 12:06
bash alias to kill all gazebo processes
alias killgz='pids=$(ps aux | grep -E "[i]gn|[g]z" | awk "{print \$2}"); [ -n "$pids" ] && echo "$pids" | xargs kill -9'
@david-wb
david-wb / bavard-chat-events.html
Created August 13, 2021 01:16
Handling Bavard Chat Window Events
<script>
(function () {
window.onBavardUserAction = function (userAction) {
if (userAction.utterance === "close") {
window.bavard.close();
} else if (userAction.utterance === "hideWidget") {
window.bavard.setVisibility(false);
} else if (userAction.utterance === "unload") {
window.unloadBavard();
}
@david-wb
david-wb / bavard.html
Created August 13, 2021 01:11
Bavard embedding script
<script defer>
window.addEventListener("bavardWidgetLoaded", () => {
window.loadBavard({
agentId: "8ff16e93-0381-4583-b008-c4aeefd1a15f",
gaTrackingCode: "<Optional GA Tracking Code>",
type: "popup",
});
});
</script>
<script defer src="https://bavard-widget-prod.web.app/main.bundle.js"></script>