Skip to content

Instantly share code, notes, and snippets.

View vmarcosp's full-sized avatar
No action can be virtuous unless it is freely chosen

Marcos Oliveira vmarcosp

No action can be virtuous unless it is freely chosen
View GitHub Profile
@vmarcosp
vmarcosp / close.svg
Created August 24, 2022 10:43
SVG do Ícone "Close"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@vmarcosp
vmarcosp / storybook-helpers.js
Created July 19, 2022 23:41
Storybook Helper for ReScript
export const withArgTypes = (component, args) => component.argTypes = args
@vmarcosp
vmarcosp / Storybook.res
Created July 19, 2022 23:41
Storybook for ReScript
module Control = {
type t
type _control =
| Radio
| Select
| Text
| Boolean
| Number({min: int, max: int, step: option<int>})
| Range({min: int, max: int, step: option<int>})
@vmarcosp
vmarcosp / Spinner.res
Created July 19, 2022 20:59
Basic spinner in ReScript
module Styles = {
open Emotion
let rotate = keyframes({
"100%": {
"transform": "rotate(360deg)",
},
})
let dash = keyframes({
@vmarcosp
vmarcosp / Emotion.res
Created July 16, 2022 15:08
Basic bindings for @emotion/css
@module("@emotion/css") external css: {..} => string = "css"
@module("@emotion/css") external rawCss: string => string = "css"
@module("@emotion/css") external keyframes: {..} => string = "keyframes"
@module("@emotion/css") external injectGlobal: {..} => unit = "injectGlobal"
@module("@emotion/css") external compose: (string, string) => string = "compose"
@vmarcosp
vmarcosp / _document.js
Created July 16, 2022 14:41
Basic config for Emotion + SSR with Next.js
import React from "react";
import createEmotionServer from "@emotion/server/create-instance";
import NextDocument, { Html, Main, Head, NextScript } from "next/document";
import { cache } from "@emotion/css";
class Document extends NextDocument {
static async getInitialProps(ctx) {
const page = await ctx.renderPage();
const initialProps = await NextDocument.getInitialProps(ctx);
const { css, ids } = renderStatic(page.html);
@vmarcosp
vmarcosp / .gitignore
Created July 14, 2022 21:10
.gitignore for Next.js and ReScript
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*
# Diagnostic reports (https://nodejs.org/api/report.html)
@vmarcosp
vmarcosp / bsconfig.json
Created July 14, 2022 20:59
Basic bsconfig.json
{
"name": "spacy",
"namespace": false,
"reason": {
"react-jsx": 3
},
"bs-dependencies": [],
"ppx-flags": [],
"sources": [
{
@vmarcosp
vmarcosp / api.json
Created October 23, 2021 16:53
Arquivo json-server - ES77 Aula #08
[
{
"id":1,
"name":"Compras da semana",
"completed":false,
"createdAt":"2021-10-23T16:52:45.875Z"
},
{
"id":2,
"name":"Compras da semana",
@vmarcosp
vmarcosp / spinner.svg
Created October 18, 2021 18:24
Animated Spinner - Curso EcmaScript 2077
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.