Skip to content

Instantly share code, notes, and snippets.

View hsribei's full-sized avatar

Helder S Ribeiro hsribei

View GitHub Profile
@hsribei
hsribei / get-files-recursive-sync.js
Created July 11, 2018 03:20
List files recursively in nodejs then do some ad-hoc filtering and renaming
const fs = require('fs')
const path = require('path')
const child_process = require('child_process')
function getFilesRecursiveSync(folder) {
const fileContents = fs.readdirSync(folder)
return fileContents.reduce(function(matches, fileName) {
const filePath = path.join(folder, fileName)
const stats = fs.lstatSync(filePath)
@hsribei
hsribei / teachable-markdown-example.min.js
Last active November 14, 2018 03:09
Sample code to render markdown client-side on Teachable
parcelRequire=function(e,r,n,t){var i="function"==typeof parcelRequire&&parcelRequire,o="function"==typeof require&&require;function u(n,t){if(!r[n]){if(!e[n]){var f="function"==typeof parcelRequire&&parcelRequire;if(!t&&f)return f(n,!0);if(i)return i(n,!0);if(o&&"string"==typeof n)return o(n);var c=new Error("Cannot find module '"+n+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[n][1][r]||r},p.cache={};var l=r[n]=new u.Module(n);e[n][0].call(l.exports,p,l,l.exports,this)}return r[n].exports;function p(e){return u(p.resolve(e))}}u.isParcelRequire=!0,u.Module=function(e){this.id=e,this.bundle=u,this.exports={}},u.modules=e,u.cache=r,u.parent=i,u.register=function(r,n){e[r]=[function(e,r){r.exports=n},{}]};for(var f=0;f<n.length;f++)u(n[f]);if(n.length){var c=u(n[n.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=c:"function"==typeof define&&define.amd?define(function(){return c}):t&&(this[t]=c)}return u}({"5bmg":[function(require,module,exports) {
"use stric