This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * FUNCTION = (inputData) => string | |
| * Creates the lesson slug based on the data passed in | |
| * -- | |
| * Takes in all the inputData we are working with and uses the title, composer name, | |
| * artist name and other information to construct the slug which we use in the lesson | |
| * URL, i.e. https://tonebase.co/lessons/preview/__________ (ex: leo-brouwer-teaches-estudios-sencillos-by-leo-brouwer) | |
| */ | |
| function constructSlug(inputData) { | |
| // == EXTRACT DATA FROM INPUT DATA |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Your init script | |
| # | |
| # Atom will evaluate this file each time a new window is opened. It is run | |
| # after packages are loaded/activated and after the previous editor state | |
| # has been restored. | |
| # | |
| # An example hack to log to the console when each text editor is saved. | |
| # | |
| # atom.workspace.observeTextEditors (editor) -> | |
| # editor.onDidSave -> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| axios.get('https://medium.com/@tonebaseteam/latest?format=json').then(function (html) { | |
| // First we get the HTML version of the json results | |
| let unParsedData = html.data.toString(); | |
| //console.log(unParsedData) | |
| // Now we need to strip the CORS security buffer used by Medium | |
| // I.E. they add "])}while(1);</x>" to the beginning of each response | |
| // so you cant just simply parse the JSON data | |
| unParsedData = unParsedData.slice(16, unParsedData.length); | |
| //console.log(unParsedData); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| stopBodyScrolling(bool) { | |
| if (bool === true) { | |
| document.body.addEventListener("touchmove", (e) => { | |
| e.preventDefault() | |
| }, false); | |
| } else { | |
| document.body.removeEventListener("touchmove", (e) => { | |
| e.preventDefault() | |
| }, false); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function [components variances] = pca(X, m) | |
| close all | |
| % We start yby calcing the mean | |
| % This gives us a 1 x i matrix with the average of all i rows of an image | |
| meanX = mean(X); | |
| % Now iterate through X and center the values | |
| for i = 1:size(X,1) | |
| for j = 1:size(X,2) |