Skip to content

Instantly share code, notes, and snippets.

View diemoritat's full-sized avatar
:octocat:
I may be slow to respond.

Nayara Alves diemoritat

:octocat:
I may be slow to respond.
View GitHub Profile
@diemoritat
diemoritat / Component.js
Created April 2, 2021 22:18
useModal hook
import React from 'react';
import useModalState from './useModalState';
import Modal from './Modal'; // import your modal component here
const Component = () => {
const { isOpen, onOpen } = useModalState(); // import the state controller and the triggers you might need
const handleCTAClick = () => {
onOpen();
};
@diemoritat
diemoritat / destructuring.js
Created September 7, 2019 17:14 — forked from mikaelbr/destructuring.js
Complete collection of JavaScript destructuring. Runnable demos and slides about the same topic: http://git.mikaelb.net/presentations/bartjs/destructuring
// === Arrays
var [a, b] = [1, 2];
console.log(a, b);
//=> 1 2
// Use from functions, only select from pattern
var foo = () => [1, 2, 3];
@diemoritat
diemoritat / ES2015In20Minutes.js
Created March 20, 2018 17:15 — forked from danilosilvadev/ES2015In20Minutes.js
A quick guide to reference the ES06
//This gist is a fast reference to ES06 to whose already knows es05.
//I'm trying to use a different approach: first the example and after the explanation.
//Lesson 1: Template literals
console.log(`hello ${firstname},
how are you?`);
//Template literals are string literals with support for interpolation(using ${variable}) and multiple lines.
@diemoritat
diemoritat / index.html
Created January 12, 2018 19:06
o barato é loko mesmo
<html>
<head>
<title>Treino de Hoje</title>
<link type="text/css" rel="stylesheet" href="style.css">
<link href="https://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Anton" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Oswald" rel="stylesheet">
</head>
<body>