Skip to content

Instantly share code, notes, and snippets.

View flaviouk's full-sized avatar

Flávio Carvalho flaviouk

View GitHub Profile
flaviouk / Setmatrix.js
Created June 18, 2021 16:01
Dynamic github actions
const packages = require('../../changed.json').map(({ name, version }) => ({
os: process.env.OS,
node: process.env.NODE,
const matrix = JSON.stringify({
include: packages,
flaviouk /
Created October 30, 2020 21:39 — forked from tannerlinsley/
Replacing Create React App with the Next.js CLI

Replacing Create React App with the Next.js CLI

How dare you make a jab at Create React App!?

Firstly, Create React App is good. But it's a very rigid CLI, primarily designed for projects that require very little to no configuration. This makes it great for beginners and simple projects but unfortunately, this means that it's pretty non-extensible. Despite the involvement from big names and a ton of great devs, it has left me wanting a much better developer experience with a lot more polish when it comes to hot reloading, babel configuration, webpack configuration, etc. It's definitely simple and good, but not amazing.

Now, compare that experience to Next.js which for starters has a much larger team behind it provided by a world-class company (Vercel) who are all financially dedicated to making it the best DX you could imagine to build any React application. Next.js is the 💣-diggity. It has amazing docs, great support, can grow with your requirements into SSR or static site generation, etc.

So why

# This gets our prod dependencies installed and out of the way
FROM node:12-alpine as base
ENV NODE_ENV=production
RUN apk update && apk add --no-cache tini
# Allows us to stop the server with Ctrl + C
ENTRYPOINT ["/sbin/tini", "--"]
COPY package*.json ./
import { generateGitlabCIContents } from '~/gitlab'
import { CIConfig, CI } from '~/interfaces'
describe('[GITLAB]', () => {
it('should output the correct gitlab config', () => {
enum Stages {
INSTALL = 'install',
BUILD = 'build',
TEST = 'test',
DEPLOY = 'deploy',
flaviouk / machine.js
Last active December 6, 2019 16:42
Generated by XState Viz:
id: 'marxent',
initial: 'PENDING',
context: {
token: null,
error: null,
states: {
on: {
flaviouk / machine.js
Last active December 6, 2019 11:45
Generated by XState Viz:
// Available variables:
// - Machine
// - interpret
// - assign
// - send
// - sendParent
// - spawn
// - raise
// - actions
find . -name "node_modules" -type d -prune -exec rm -rf '{}' +