Skip to content

Instantly share code, notes, and snippets.

@Reeska
Reeska / rename-js-to-jsx.js
Last active May 8, 2024 15:49
A script to convert .js to .jsx when they contains JSX tags
// node ./rename-js-to-jsx.js ./my/folder
const fs = require('fs')
const path = require('path')
// Options
const src = process.argv[2] ?? './'
const pattern = process.argv[3] ? new RegExp(`${process.argv[3]}$`) : /.js$/
const newExtension = process.argv[4] ?? '.jsx'
@Reeska
Reeska / owl-schedule.js
Created April 15, 2021 20:56
Overwatch League Schedule in local datetime
const matches = data.content.tableData.events[0].matches
const mapMatch = (match) => {
const title = match.competitors.map(team => team.name).join('-')
return {
title: title,
start: new Date(match.startDate).toLocaleString(),
}
}