Skip to content

Instantly share code, notes, and snippets.

View Bucephalus-lgtm's full-sized avatar
🎴
Work hard in silence and let your success makes the noise.

Bhargab Nath Bucephalus-lgtm

🎴
Work hard in silence and let your success makes the noise.
View GitHub Profile
{

    "message": {

        "id": 0,

        "unique_id": "fbe19476-adee-4fc8-b100-21b7366ba6d2",

        "caller": "+918035242008",

Prompt: Make certain date ranges come out with different answers in a Google Sheet

Overview

In this prompt, you will create a Google Sheet table that assigns different values to different date ranges using an IF statement. This can be useful if you need to analyze data that spans multiple time periods and want to assign different categories or labels to each period.

Steps

  1. Open a new Google Sheet and create a table with three columns: "Start Date," "End Date," and "Result."

Converting an Excel Template to a PDF Form and Add SUMIF formula using JavaScript

Step 1: Create an Excel Template

The first step is to create an Excel template that will be used to generate the PDF form. This template should include all of the necessary fields and formatting for the form.

Step 2: Convert Excel Template to PDF Form

Once the Excel template is complete, it can be converted to a PDF form using a tool such as Adobe Acrobat Pro or an online converter. This will create a PDF form that includes all of the fields and formatting from the Excel template.

How to Change the Local Timezone of Your Firebase Hosting Server

If your website is hosted on Firebase Hosting and you need to change the server's timezone to UTC-6 (Central Standard Time), you can do so by configuring the timezone in your Firebase project's Cloud Functions. Here's how:

  • Open the Firebase Console and select your project.
  • Click on the "Functions" tab on the left-hand side menu.
  • Click on the "Settings" icon (gear icon) next to the "Overview" tab.
  • Scroll down to the "Advanced settings" section and click on the "Edit" button.
@Bucephalus-lgtm
Bucephalus-lgtm / Configuration for Snowflake API to tackle HTTP request.md
Last active March 29, 2023 15:29
Snowflake is a data warehousing system that is cloud-based that lets users to store and analyse massive volumes of structured and semi-structured data. This gist contains a Python script that performs SQL and NoSQL queries on a Snowflake database and returns the results in JSON format. The script connects to the Snowflake database using the snow…

Utility Function for Snowflake

It accepts a query string as well as an is_sql boolean flag. If is_sql is set to True, the query is executed as a SQL query and the results are returned as a list of dictionaries. If is_sql is False, the query is executed as a NoSQL query and the results are returned as a collection of dictionaries.

snowflake_utils.py

import snowflake.connector
import json

SNOWFLAKE_ACCOUNT = "your_account"

Procedures for integrating the stripe payment gateway with Node.js Express.js backend:

  • Install stripe package from npm
$ npm install stripe
  • Import the Stripe module in your backend server file
 const stripe = require('stripe')('sk_test_your_api_key_here');
const puppeteer = require('puppeteer');

(async () => {
  // Launch a new browser instance
  const browser = await puppeteer.launch();

  // Create a new page instance
  const page = await browser.newPage();

The below code explains how you can write save and write API as per your requirements:

index.js
/**
 * @author: Bhargab Nath  <bhargabnath691@gmail.com>
 *
 */

Flow diagram for my approach:

snov-clay-api-integration


Code snippet for Snov and Clay APIs integration using axios package in Node.js:

const axios = require('axios');

// Snov API

The basic flow is this:

First build the Docker image and then run it in Portainer.

Steps:

  • Build the Docker image:
 docker build -t <__your_image_name__>
  • Launch Portainer:
docker run -d -p 9000:9000 --name=portainer --restart=always -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer