Skip to content

Instantly share code, notes, and snippets.

View pavan168's full-sized avatar
:octocat:
typing...

Pavan Welihinda pavan168

:octocat:
typing...
  • Sri Lanka
View GitHub Profile
@zanona
zanona / sentry-serverless-firebase.ts
Last active June 8, 2024 21:11
Missing Sentry's firebase serverless wrappers
/**
* Temporary wrapper for firebase functions until @sentry/serverless support is implemented
* It currently supports wrapping https, pubsub and firestore handlers.
* usage: https.onRequest(wrap((req, res) => {...}))
*/
import type {Event} from '@sentry/types';
import type {https} from 'firebase-functions';
import type {onRequest, onCall} from 'firebase-functions/lib/providers/https';
import type {ScheduleBuilder} from 'firebase-functions/lib/providers/pubsub';
import type {DocumentBuilder} from 'firebase-functions/lib/providers/firestore';
@phuctm97
phuctm97 / get-webpack-alias-from-tsconfig.js
Last active November 2, 2022 06:32
📎 Get Webpack alias from tsconfig.json, aka. convert tsconfig.json paths to Webpack alias
const path = require('path');
/**
* Helper function infers Webpack aliases from tsconfig.json compilerOptions.baseUrl and
* compilerOptions.paths.
*
* @param {string} tsconfigPath - Path to tsconfig.json (can be either relative or absolute path).
* @return {object} An object representing analogous Webpack alias.
*/
module.exports = (tsconfigPath = './tsconfig.json') => {
@CodingDoug
CodingDoug / README.md
Created December 5, 2019 02:24
How to schedule a Cloud Function to run in the future (in order to build a Firestore document TTL)
@remmel
remmel / facebook-messenger-bot.php
Last active November 5, 2021 18:01
Basic example of a Facebook Messenger Bot
<?php
// parameters
$hubVerifyToken = 'TOKEN123456abcd';
$accessToken = "xxx";
// check token at setup
if ($_REQUEST['hub_verify_token'] === $hubVerifyToken) {
echo $_REQUEST['hub_challenge'];
exit;
}