Skip to content

Instantly share code, notes, and snippets.

View khpraful's full-sized avatar

Praful Khandelwal khpraful

View GitHub Profile
@khpraful
khpraful / App.js
Created November 30, 2023 10:25
ReactJs integration with Helpjuice
import React from 'react';
import HelpJuiceArticles from './components/HelpJuiceArticles';
const App = () => {
return (
<div className="App">
<HelpJuiceArticles />
</div>
);
};
@khpraful
khpraful / invoke_mwaa_dag_from_js.js
Created July 25, 2023 03:29
Invoking MWAA DAG from JavaScript
const axios = require('axios');
const { MWAAClient, CreateCliTokenCommand } = require('@aws-sdk/client-mwaa');
const client = new MWAAClient({ region: 'AWS_REGION' });
const environmentName = 'MWAA_ENV_NAME'
const dagName = 'DAG_NAME';
const payload = {
}
from pymongo import MongoClient
import sys
import json
from datetime import datetime
def get_database(env, dbName):
if env == 'local' :
connection_string = "mongodb://localhost:27017/?readPreference=primary&appname=MongoDB%20Compass&directConnection=true&ssl=false"
client = MongoClient(connection_string)
return client[dbName]
@khpraful
khpraful / n8n configuration files
Created September 3, 2022 16:05
n8n configuration files for kubernetes deployment
n8n configuration files for kubernetes deployment
@khpraful
khpraful / README.md
Created April 19, 2022 16:59
Approve deployment requests programatically using Azure DevOps REST APIs

Azure-DevOps-RESTful-Sample

In the config.py file, add the assignee (person or group) in the user field and personal access token (generated through Azure DevOps) in the token field
In the approve_deployments.py file, replace organization with Azure DevOps organization name and project with the name of project under that organizaiton in the urls
Execute approve_deployments.py
It will display list of all pending approvals for the configured user along with useful details such as release pipeline name, environment, approval type, etc in order to make informed decision
It will also display the list of approval ids
Enter the approval ids you would like to approve in comma-separated fashion. The list of approval ids is available as output in above step in case you want to copy-paste and approve the entire list in one go. Please make sure to provide only comma-separated list without any column brackets ([ ]) at beginning and end
It will ask for confirmation. To con