Category Archives: Javascript

GDPR & AdSense: How to Create a Cookie Consent Modal that Defers Ads from Loading

Here you can find the code to accompany my video on blocking AdSense scripts from loading until the user has given consent: Here’s the HTML code for the consent modal: <div id=”consentModal” class=”modal fade” tabindex=”-1″ role=”dialog” aria-hidden=”false” data-backdrop=”static” data-keyboard=”false”> <div class=”modal-dialog”> <div class=”modal-content”> <div class=”modal-body”> <h2 class=”text-center”>Trust and transparency is important to us.</h2> <p class=”text-justify”> […]

Google Dialogflow Chatbot & Realtime Database Tutorial: Read & Write Data

I published a tutorial video on how to read from and write to the Firebase Realtime Database using snapshots and transactions. This blog post contains the code examples from the video: Here is the index.js for the first step which is just reading from the database using a snapshot: const functions = require(‘firebase-functions’); const {WebhookClient} […]

Google Dialogflow Chatbot & Slack Tutorial: Trigger a Slack Notification from a Firebase Webhook

In this blog post I’m going to share the code from my video tutorial on how to trigger a Slack message from a Dialogflow chatbot: Here is the index.js: // See // for Dialogflow fulfillment library docs, samples, and to report issues ‘use strict’; const functions = require(‘firebase-functions’); const {WebhookClient} = require(‘dialogflow-fulfillment’); const requestLib = require(‘request’); […]

EmberCamp 2015 notes

I was lucky enough to be attending the EmberCamp conference in London on the 29th of October 2015. It was the first Ember conference I ever went to and featuring talks by core contributors like Yehuda Katz and Matthew Beale. Here are some notes I took about the conference in the form of bullet points […]