Skip to content

Instantly share code, notes, and snippets.

View mitchell-merry's full-sized avatar

Mitchell Merry mitchell-merry

  • Atlassian
  • Sydney, Australia
View GitHub Profile
@mitchell-merry
mitchell-merry / tasks.json
Last active August 12, 2022 09:36
VSCode build tasks for .pml (PROMELA)
{
"version": "2.0.0",
"tasks": [
{
"label": "Compile C file with cc.",
"type": "shell",
"command": "cc ${relativeFile}",
"windows": {
"command": "gcc ${relativeFile}"
},
@mitchell-merry
mitchell-merry / .md
Last active July 5, 2022 05:08
Discord.js, TypeScript, TypeORM, Docker, MySQL project setup

Initialise Node

npm init in the folder to setup in.

  • Add type to package.json and set it to commonjs. We will be compiling TypeScript to CommonJS for execution, so when node executes the compiled files it should do it as CJS.

Install Packages

discord.js: npm i discord.js @discordjs/rest discord-api-types @discordjs/builders

  • discord.js is the main package for connecting to Discord with node.js
  • @discordjs/rest to authorise a connection to the Discord API
@mitchell-merry
mitchell-merry / react-component-lib-notes.md
Last active September 5, 2021 18:24
Setting up a React Component Library & Challenges in Learning New Technology

Introduction

Recently, I began a new endeavour on a new project that would hopefully expand upon some of my old skills and start to expose new technologies I hadn't yet had the chance to work in. I chose to make a 'UI Kit', or in this case a React Component Library. What I hadn't expected was how difficult it would be to get a project like this off the ground.

My first goal was to create a package that I could include in other projects as a node module that would have many different preset React components included to speed up development time / mimic professional workflows. Because I had never done anything like this, I would need to wrap my head somewhat around many new technologies, including Bundlers, Rollup, Storybook, and eventually TypeScript as I thought it would be a good chance to learn how.

Ultimately, the setup phase involved the following:

  • TypeScript
  • Sass/Scss
  • JSX
  • All of the above plus regular JS and CSS to be (pre)processed and bundled for distribution, using Rollup and various plugi