Using NodeJS and Puppeteer.
Creating a fake data server with ExpressJS, EJS and TailwindCSS.
- Add this files do any directory
- Run
npm install
import { useState } from 'react' | |
export default function useMap<K, V>(): [ | |
Map<K, V>, | |
{ | |
set: (key: K, value: V) => void | |
unset: (key: K) => void | |
clear: () => void | |
} | |
] { |
Note: This document is still a work in progress! Please let us know where it lacks so we can make the migration as smooth as possible!
When we set out to build React Router v6, from the perspective of @reach/router users, we had these goals:
//////////////////////////////////////////////////////////////////////////////// | |
// Welcome to @reach/tooltip! | |
// | |
// Quick definitions: | |
// | |
// - "on rest" or "rested on": describes when the element receives mouse hover | |
// after a short delay (and hopefully soon, touch longpress). | |
// | |
// - "activation": describes a mouse click, keyboard enter, or keyboard space. | |
// |
// store-provider.js | |
import React, { createContext, useReducer, useContext } from 'react'; | |
const defaultState = { | |
counter: 0, | |
}; | |
function reducer(state = defaultState, action = {}) { | |
switch (action.type) { |
I've been using create-react-app lately as I find it very useful to kick things off while starting a project. I almost always follow JavaScript Standard Style and I found myself googling it so I figured out I should write it down.
I really like keeping dependencies as local as possible but if you prefer you can install it globally.
yarn add standard --dev
or
Inspired by dannyfritz/commit-message-emoji
See also gitmoji.
Commit type | Emoji |
---|---|
Initial commit | 🎉 :tada: |
Version tag | 🔖 :bookmark: |
New feature | ✨ :sparkles: |
Bugfix | 🐛 :bug: |
// Enter the day you would like to create | |
WITH { day: 18, month: 1, year: 2014 } as dayMap | |
// Merge hours in a day | |
MERGE (thisDay:Day { day: dayMap.day, month: dayMap.month, year: dayMap.year }) | |
MERGE (firstHour:Hour { day: dayMap.day, month: dayMap.month, year: dayMap.year, hour: 1 }) | |
CREATE (thisDay)-[:FIRST]->(firstHour) | |
FOREACH (i IN tail(range(1, 24)) | | |
MERGE (thishour:Hour { day: dayMap.day, month: dayMap.month, year: dayMap.year, hour: i }) | |
MERGE (lasthour:Hour { day: dayMap.day, month: dayMap.month, year: dayMap.year, hour: i - 1 }) |
var mongoose = require('mongoose'); | |
mongoose.connect('mongodb://localhost/test'); | |
var db = mongoose.connection; | |
db.on('error', function() { | |
return console.error.bind(console, 'connection error: '); | |
}); | |