Skip to content

Instantly share code, notes, and snippets.

View rs77's full-sized avatar

Ryan rs77

View GitHub Profile

If you've been tinkering around with the wonderful Advanced PDF/HTML Template within NetSuite there are times when you'll receive some ambiguous errors.

I received one today which had me scratching my head for quite some time, it was:

Problem saving template: Index: 2, Size: 2

-NetSuite Advanced Template error

Whenever you encounter this error it's trying to tell you there's an error in your table structure with the number of rows and cells - this will need fixing otherwise it will not save your template.

Recently I helped a friend with some basic DNS issues with a website he was setting up for his wife's home based internet business.

I gladly helped out and set him up with a free CloudFlare account and asked him what he wanted to do in setting up an email server – as Google Mail had ceased as being a free offering for businesses since early December 2012.

The only two alternatives I know of and provide are:

  • Microsoft's domains.live.com (no longer supported)
  • Zoho Mail

My friend opted to sign up for Zoho Mail, and I went through the process of setting up a free account in a matter of minutes. It was relatively straightforward, and I confirmed the domain my friend was using in Zoho using the CNAME method thanks to CloudFlare's easy set up (even though I stuffed pointing the CNAME to Zoho's server! Oops.).

@rs77
rs77 / secure-s3-website-cloudfront.md
Created December 9, 2022 21:34
How to create a secure S3 website using AWS Cloudfront

If you have made the migration to host your website using Amazon's S3 service and encounter issues with serving your content through a secure certificate or even trying to get Cloudflare to connect then this article will hopefully help set your connection right.

To help illustrate the concepts behind the connection, I'll use a site I once owned to show the entire process freeworksheetsmath.com.

Step 0 - Log in AWS & Cloudflare Accounts

This is perhaps the easiest out of all the steps, although the rest aren't too bad, but to get started you will need to log in to your AWS and your Cloudflare accounts.

Our first X steps will be in the AWS area, then towards the end we finish up with Cloudflare.

@rs77
rs77 / install-nodejs-on-macos.md
Created December 9, 2022 21:32
How to install NodeJS on Mac OS

The problem I have with NodeJS is having it automatically update itself. I don't want to have to re-install the direct downloadable file from NodeJS every time there's a patch update.

Wouldn't it be great to install it once, and when needed, run a command for it to automatically update?

Thankfully there is such an easy process: Homebrew for Mac

So here were the steps I undertook to be able to reinstall NodeJS back on to my computer:

Is NodeJS Already Installed?

@rs77
rs77 / sumifs-total-once-group.md
Created December 8, 2022 19:18
How do you calculate a total at each unique instance of a row? Here's one method using `COUNTIFS` with `SUMIFS`:

How do you find the sum of data according to each unique instance of values in a column and then insert the sum calculation for each unique cell at the first or last instance?

Suppose you have a data set of sales staff and how much they received for each project, but then you needed to find out how much tax to withhold from their pay with this final calculation happening on their gross earnings for the month.

Here's a simple demonstration illustrating the problem:

A B C D
1 Employee Name Sales Comm Total
2 Smith, John 4,000 400
@rs77
rs77 / google-sheets-multi-select-dropdown.js
Last active February 14, 2023 14:23
Google App Script to enable users on a Google Sheet to select multiple options on a dropdown menu. Demonstration and more information here: https://scripteverything.com/google-sheets-drop-down-list-multiple-select/
/**
* @param {SheetsOnEdit} e - edit event object
*/
function onEdit(e) {
/**
* @typedef {Object} MultiDropDown
* @property {String} namedRange
* @property {Number} handlingDuplicates
* @property {String} separator
* @property {Boolean} sortResult
@rs77
rs77 / Suitescript-ReferenceError-Unable-To-Find-Bridge.md
Created December 5, 2022 20:05
SuiteScript: ReferenceError Unable to Find Bridge [xmlAPI]

If you're trying to debug a SuiteScript using the debug window within NetSuite and get the oblique error message:

ReferenceError: Unable to find bridge [xmlApi], with parent [N/error]: ReferenceError: xmlApi

Helpful SuiteScript system JS_EXCEPTION

@rs77
rs77 / Wordpress-Markdown-YAML.md
Created December 5, 2022 20:02
Convert Wordpress Into Markdown Files With YAML Front Matter (PHP Script)

Now we're ready to begin our journey on extracting our WordPress content into a format needed for our static site generator, the big question becomes:

What format do we want to be able to extract our WordPress data into?

We have a plethora of choices available, but I like having YAML front-matter at the top of my posts and pages (to control HOW the content will be embedded), which is what many of the popular static site generators prefer too. However, I want the flexibility of being able to write my own custom header information which is what a YAML-like header on my posts and pages will provide.

For the content I'd like it to be Markdown based, even though when we get the data it will be a mix of HTML and Markdown (unless you've specifically written in <p> tags for every paragraph break in your content). I'd prefer to continue writing in Markdown and then be able to process my content into HTML for uploading to my static site.

Therefore, the way I have constructed my output is a little like this:

@rs77
rs77 / Mistakes-Jekyll-Front-Matter.md
Created December 5, 2022 20:01
Common Mistakes With Jekyll Front Matter

As I don't blog very often whenever I create a new blog post in GitHub Pages (using Jekyll's template framework) there a couple of times I forget the basics and spend a few minutes trying to figure out why the page didn't load properly.

So this post today is more of a note to self.

Firstly, for blog posts name the file according to the following convention:

YYYY-MM-DD-BlahBlah.md

Secondly, in the front matter area don't use another colon in the value of the variable. For example don't do this:

@rs77
rs77 / Open-File-Terminal-Coda-2.md
Created December 5, 2022 19:59
How To Easily Open A File From Terminal In Coda 2

I've been playing a lot more with Coda 2 upon purchasing it since its initial release a couple of weeks ago. While I had been teetering on purchasing version 1 last year, I held off on anticipation of the version 2 release. In the meantime I played with Sublime Text 2.

While I'm certainly no coding ninja I did find Sublime Text 2 a little difficult to undertake all my grasshopper coding stuff. In most cases I found 4 pieces of software open for my workflow:

  1. The Sublime Text editor itself (where all the coding action happened)
  2. Terminal (where I would interface with the server)
  3. Panic's Transmit (if needed when uploading images, etc.)
  4. The browser (to check everything was working)

During this time I wore out my ⌘-Tab keys a lot!