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
export function getTimeSignatureinSemiQuavers(timeSignature: MidiTimeSignatureEvent): TimeSignatureValues { | |
const { numerator, denominator } = timeSignature | |
const deltaFromSemiQuaver = 4 - denominator | |
if (deltaFromSemiQuaver > 0) { | |
return Array(deltaFromSemiQuaver).fill(0).reduce((agg) => { | |
return { | |
numerator: agg.numerator * 2, | |
denominator: agg.denominator * 2 | |
} | |
}, { numerator, denominator: 2**denominator }) |
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
// a lot of config removed for brevity | |
module.exports = { | |
plugins: [ | |
{ | |
resolve: `@lekoarts/gatsby-theme-minimal-blog`, | |
options: { | |
mdx: 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
import {read} from 'to-vfile' | |
import {unified} from 'unified' | |
import rehypeParse from 'rehype-parse' | |
import rehypeRemark from 'rehype-remark' | |
import remarkStringify from 'remark-stringify' | |
import { writeFile, promises as fs } from 'fs' | |
import {toHtml} from "hast-util-to-html" | |
import frontmatter from 'remark-frontmatter' | |
import path from 'path' |
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
import {read} from 'to-vfile' | |
import {unified} from 'unified' | |
import rehypeParse from 'rehype-parse' | |
import rehypeRemark from 'rehype-remark' | |
import remarkStringify from 'remark-stringify' | |
import {visit} from "unist-util-visit"; | |
function removeMediumExtras() { | |
return (tree) => { | |
const article = tree.children.find(x => x.tagName === 'article') |
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
import fetch from 'node-fetch' | |
import {read} from 'to-vfile' | |
import {unified} from 'unified' | |
import rehypeParse from 'rehype-parse' | |
import rehypeRemark from 'rehype-remark' | |
import remarkStringify from 'remark-stringify' | |
import { selectAll } from "hast-util-select"; | |
import {toHtml} from "hast-util-to-html"; | |
async function downloadGistCode(url) { |
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
import fetch from 'node-fetch' | |
import {read} from 'to-vfile' | |
import {unified} from 'unified' | |
import rehypeParse from 'rehype-parse' | |
import rehypeRemark from 'rehype-remark' | |
import remarkStringify from 'remark-stringify' | |
import { writeFile, promises as fs } from 'fs' | |
import { selectAll } from "hast-util-select"; | |
import {toHtml} from "hast-util-to-html"; | |
import path from 'path' |
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
import { read } from 'to-vfile' | |
import { unified } from 'unified' | |
import rehypeParse from 'rehype-parse' | |
import rehypeRemark from 'rehype-remark' | |
import remarkStringify from 'remark-stringify' | |
import frontmatter from 'remark-frontmatter' | |
import slugify from 'slugify' | |
function gatherFrontmatterData() { | |
return async (tree, file) => { |
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
import fetch from 'node-fetch' | |
import {read} from 'to-vfile' | |
import {unified} from 'unified' | |
import rehypeParse from 'rehype-parse' | |
import rehypeRemark from 'rehype-remark' | |
import remarkStringify from 'remark-stringify' | |
import { writeFile, promises as fs } from 'fs' | |
import { selectAll } from "hast-util-select"; | |
import {toHtml} from "hast-util-to-html"; | |
import slugify from "slugify"; |
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
return data.map((issue) => { | |
return { | |
title: issue.title, | |
count: issue.count, | |
culprit: issue.culprit, | |
url: issue.permalink, | |
level: issue.level, | |
ref: issue.shortId | |
} | |
}) |
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
return data.results[0].result.map((step) => { | |
return { | |
key: step.name, | |
value: step.count | |
} | |
}) |