Skip to content

Instantly share code, notes, and snippets.

hughsw / excelgist.js
Created Jun 23, 2019
Basic basic bootstrapping example for exceljs
View excelgist.js
// See:
const Excel = require('exceljs');
// create workbook & add worksheet
const workbook = new Excel.Workbook();
const worksheet = workbook.addWorksheet('Discography');
// add column headers
worksheet.columns = [
hughsw / collectSymbols.js
Last active Jun 10, 2019
Versions of collectSymbols
View collectSymbols.js
const input = ['AED_AFN', 'ALL_AMD', 'AMD_AFN', 'ALL_GBP'];
console.log('input:', JSON.stringify(input));
// somewhat functional, somewhat imperative
const collectSymbols0 = pairs => {
hughsw / CollectCurrencyPairs.txt
Last active May 25, 2019
Javascript data wrangling
View CollectCurrencyPairs.txt
Real-world, little Javascript problem
Input is an array of strings.
Each string encodes a pair of 3-letter symbols, separated by an underscore '_'.
We talk about the left-hand and right-hand symbols that are encoded into the string.
'AED' is the left-hand symbol of the first pair; 'AFN' is the right-hand symbol of the first pair. Etc.
We want this data rearranged into an object.