Skip to content

Instantly share code, notes, and snippets.

View rohit1101's full-sized avatar
🏠
Working from home

rohit1101

🏠
Working from home
View GitHub Profile
@rohit1101
rohit1101 / gist:8ad26d3922d3bdc609ff7f19450fe77f
Created October 27, 2022 05:15
automate sending emails to super admins from strapi
We need a tool for monitoring or detecting for changes made on strapi.
Luckily, we can make use of Webhook for the detecting any changes (CRUD) on strapi.
While creating our webhook we need to provide an endpoint that would receive the response
data from webhook which has the information what has changed on strapi.
After receiving the data from webhook we can call a service sendEmail()
sendEmail() will process the data and send the required data to super admins to their respective
@rohit1101
rohit1101 / gist:0546e81d2e9e49e96d9c83104e20d9c9
Last active October 14, 2022 06:59
Automate stellate purging
Currently we have implemented manual cache clear using a plugin.
But since we need to automate the cache clear on stellate if anyone adds, updates or deletes content on strapi prod we need to think how to implement this.
As you suggested we can try to use webhook, but the problem with webhook is that there is not support for webhook integration from stellate (strapi supports webhook integrations).
And we also need a URL to provide for the webhook on strapi to trigger an event(adds, updates or deletes content on strapi) to purge cache on stellate.
I raised a query to stellate team to check if there are any support or alternatives for webhook support, but currently they are not focussing on webhooks and integration and they are focussed on improving performance of edge cache.
@rohit1101
rohit1101 / ayana.com & tnc
Last active September 23, 2022 07:14
ayana.com
#tnc
rewrite
^/bali/the-villas/terms-and-conditions(/|$)
https://www.ayana.com/bali/the-villas-ayana/terms-and-conditions
redirect;
rewrite
^/bali/rimba/terms-and-conditions(/|$)
https://www.ayana.com/bali/rimba-jimbaran/terms-and-conditions
@rohit1101
rohit1101 / .md
Created April 5, 2022 13:22
Blog - 01

What are tagged template literals ?

We are already aware of template literal as shown below:

const name="Groot"
console.log(`I am ${name}`)
@rohit1101
rohit1101 / .md
Created March 7, 2022 07:30
CardBlock Write Up
  • Required Data:
    • Relation with images content type (map image/ getting here truck image)
    • Title
    • Subtitle (for highlighted rockbar-bali card on bali dining)
    • Description ((for highlighted rockbar-bali card on bali dining)
    • ctaText (for highlighted rockbar-bali card on bali dining)
    • ctaLink (for highlighted rockbar-bali card on bali dining)
    • Address
    • Phone number
    • email address
@rohit1101
rohit1101 / index.js
Created May 20, 2021 16:32
nodejs_basics
const http = require("http");
const url = require("url");
const hostname = "127.0.0.1";
const port = 3000;
const server = http.createServer((req, res) => {
// Create an endpoint to read headers from request
const queryParam = url.parse(req.url, true).query;
console.log(queryParam, req.headers.host);
console.log(req.url, req.method);