Skip to content

Instantly share code, notes, and snippets.

@rosinghal
rosinghal / cloudways-clone.js
Last active September 11, 2020 13:17
NodeJS script to clone or delete app from CloudWays
const Axios = require("axios");
const readline = require("readline");
const rl = readline.createInterface({
input: process.stdin,
output: process.stdout
});
const axiosInstance = Axios.create({
baseURL: "https://api.cloudways.com/api/v1"
@rosinghal
rosinghal / github-issues-to-csv.js
Created July 17, 2020 09:09
Export GitHub issues to CSV
const Axios = require("axios");
const { createObjectCsvWriter } = require("csv-writer");
const GITHUB_ACCESS_TOKEN = "<<GITHUB_ACCESS_TOKEN>>";
const ORG_NAME = "<<ORG_NAME>>";
const asyncForEach = async (array, callback) => {
for (let index = 0; index < array.length; index++) {
await callback(array[index], index, array);
}
@rosinghal
rosinghal / helpscout-docs-to-csv.js
Last active December 15, 2021 08:46
Export HelpScout docs to CSV
const Axios = require("axios");
const { createObjectCsvWriter } = require("csv-writer");
const HELPSCOUT_API_KEY = "<<YOUR_HELPSCOUT_API_KEY>>";
const helpscoutInstance = Axios.create({
baseURL: "https://docsapi.helpscout.net/v1",
auth: {
username: HELPSCOUT_API_KEY,
password: "X"
@rosinghal
rosinghal / gitlab.js
Created May 11, 2020 12:56
Mass update all Gitlab repositories inside group to have same integration (eg, Slack)
const Axios = require("axios");
const ACCESS_TOKEN = "YOUR_ACCESS_TOKEN";
const GROUP_ID = "GITLAB_GROUP_ID";
const WEBHOOK_URL = "YOUR_WEBHOOK_URL";
const gitlabInstance = Axios.create({
baseURL: "https://gitlab.com/api/v4",
headers: {
Authorization: `Bearer ${ACCESS_TOKEN}`