Skip to content

Instantly share code, notes, and snippets.

View gillyspy's full-sized avatar

Gerald Gillespie gillyspy

  • Ontario, Canada
View GitHub Profile
@gillyspy
gillyspy / index.d.ts
Created January 3, 2025 20:19
Useful globals in a typscript suitecloud project
/**
* @file /Users/gerald.gillespie/code/oura-ns/types/index.d.ts Class.
* @module @types/index_d_ts
* @author Gerald Gillespie <gg@suitegeezus.com>
* @NApiVersion 2.1
*/
export type ArrayElement<A> = A extends readonly (infer T)[] ? T : never;
type DeepWriteable<T> = { -readonly [P in keyof T]: DeepWriteable<T[P]> };
type Cast<X, Y> = X extends Y ? X : Y
/**
* Usually if you want to access the SuiteScript 2 API via the browser console you need to open specific pages
* that load the required libraries (such as a record in edit mode). This script will load the libraries on any
* NetSuite page
*/
(async () => {
/* Add a script element to the DOM and wait until it's loading by checking that
a known variable it creates exists */
@gillyspy
gillyspy / NetSuite Transaction Status Codes
Created September 16, 2022 21:58 — forked from W3BGUY/NetSuite Transaction Status Codes
List of NetSuite Transaction Status Names and Codes
Bill:Open <===> VendBill:A
Bill:Paid In Full <===> VendBill:B
Bill Payment:Voided <===> VendPymt:V
Bill Payment:Online Bill Pay Pending Accounting Approval <===> VendPymt:Z
Cash Sale:Unapproved Payment <===> CashSale:A
Cash Sale:Not Deposited <===> CashSale:B
Cash Sale:Deposited <===> CashSale:C
Check:Voided <===> Check:V
Check:Online Bill Pay Pending Accounting Approval <===> Check:Z
Commission:Pending Payment <===> Commissn:A
@gillyspy
gillyspy / flow-bot-azure-function.js
Created June 2, 2021 04:10 — forked from wictorwilen/flow-bot-azure-function.js
Microsoft Teams Outgoing Webhook Proxy for Microsoft Flow
const crypto = require('crypto');
const request = require('request');
const bufSecret = Buffer('OUTGOING-WEBHOOK-SECRET', "base64");
const flowWebhook = 'MICROSOFT-FLOW-URL';
module.exports = function (context, req) {
var auth = req.headers['authorization'];
// HMAC security validation
@gillyspy
gillyspy / index.html
Created October 21, 2020 20:59
JS Bin Linked Lists example // source https://jsbin.com/risakiw
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Linked Lists example">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
Linked Lists example
<!DOCTYPE html>
<html>
<head>
<meta name="description" content=""Queue implemented using Stacks">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
Queue implemented using Stacks
@gillyspy
gillyspy / index.html
Created October 19, 2020 16:57
JS Bin Example of SetInterval Tracking using a privately scoped object without an additional closure AND demonstration of differences between setInterval predictability v setTimeout recursion and loss of its predictability // source https://jsbin.com/hajikir
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Example of SetInterval Tracking using a privately scoped object without an additional closure AND
demonstration of differences between setInterval predictability v setTimeout recursion and loss of its predictability">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
@gillyspy
gillyspy / index.html
Created October 18, 2020 22:34
JS Bin Capitalize first letter in each word and return sentence // source https://jsbin.com/beguzur
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Capitalize first letter in each word and return sentence">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
Capitalize first letter in each word and return sentence
@gillyspy
gillyspy / index.html
Created October 17, 2020 22:33
JS Bin Check for Anagrams // source https://jsbin.com/fuyijug
<!DOCTYPE html>
<html>
<head>
<meta name="description" content="Check for Anagrams">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
Check for Anagrams
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<script id="jsbin-javascript">