Skip to content

Instantly share code, notes, and snippets.

View reesemartin's full-sized avatar

Reese Martin reesemartin

  • UniSyn Technologies
View GitHub Profile
@reesemartin
reesemartin / github-conventional-comments.js
Last active October 12, 2023 15:19 — forked from ifyoumakeit/github-conventional-comments.js
GitHub Conventional Comments (instructions to install in comment below code)
(async function generateReplies(document) {
// https://conventionalcomments.org/#labels
const LABEL = {
praise: "praise",
nitpick: "nitpick",
suggestion: "suggestion",
issue: "issue",
todo: "todo",
question: "question",
thought: "thought",
@reesemartin
reesemartin / json2csv.ts
Created August 10, 2022 18:53
Simple json array of objects conversion to csv string function
const jsonToCSV = (objArray: any[]): string => {
let headerRow = '';
let result = '';
const columns: any[] = [];
const keys = Object.keys(objArray[0]);
keys.forEach((key, index) => {
let keyString = `${key}`;
keyString = `"${keyString.replace(/"/g, '""')}",`; // escape quotes using double quotes and wrap in quotes
columns[index] = key;