Skip to content

Instantly share code, notes, and snippets.

View ianwcarlson's full-sized avatar

Ian Carlson ianwcarlson

  • Albuquerque, NM
View GitHub Profile
@ianwcarlson
ianwcarlson / git-branch-detail.sh
Created February 25, 2019 16:37
Git Branch Detail
for k in `git branch | sed s/^..//`; do echo -e `git log -1 --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $k --`\\t"$k";done | sort
@ianwcarlson
ianwcarlson / convertSerializedHtmlToReactElements.js
Last active November 18, 2020 19:14
Convert serialized html to react elements
// This is actually a nodejs script using string templates to demonstrate feasibility
// The potential use case for something like this is dynamically generating react
// element at run time while only supported a small subset of valid HTML elements.
// A full-blown HTML parser is also much larger and complex.
const supportedTags = [
{
tag: 'sup',
regex: /<sup>[^<>].*?<\/sup>/,
createReactElement: content => `<sup>${content}</sup>`,