| gitflow | git |
|---|---|
git flow init |
git init |
git commit --allow-empty -m "Initial commit" |
|
git checkout -b develop master |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useState, useEffect } from "react" | |
| type SSRRect = { | |
| bottom: number | |
| height: number | |
| left: number | |
| right: number | |
| top: number | |
| width: number | |
| x: number |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| console.log(Number(Math.round(1.005 + "e2") + "e-2")) // 1.01 | |
| const roundAccurately = (number, decimalPlaces) => Number(Math.round(number + "e" + decimalPlaces) + "e-" + decimalPlaces) | |
| console.log(roundAccurately(1.005, 2)) // 1.01 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Async/Await requirements: Latest Chrome/FF browser or Babel: https://babeljs.io/docs/plugins/transform-async-to-generator/ | |
| // Fetch requirements: Latest Chrome/FF browser or Github fetch polyfill: https://github.com/github/fetch | |
| // async function | |
| async function fetchAsync () { | |
| // await response of fetch call | |
| let response = await fetch('https://api.github.com'); | |
| // only proceed once promise is resolved | |
| let data = await response.json(); | |
| // only proceed once second promise is resolved |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // List all files in a directory in Node.js recursively in a synchronous fashion | |
| var walkSync = function(dir, filelist) { | |
| if( dir[dir.length-1] != '/') dir=dir.concat('/') | |
| var fs = fs || require('fs'), | |
| files = fs.readdirSync(dir); | |
| filelist = filelist || []; | |
| files.forEach(function(file) { | |
| if (fs.statSync(dir + file).isDirectory()) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <div class="root en"> | |
| <ul class="links"> | |
| <li class="link"> | |
| <a class="link-home"><i class="icon">tag</i>HOME</a> | |
| </li> | |
| <li class="link"> | |
| <a class="link-about"><i class="icon">tag</i>ABOUT</a> | |
| </li> | |
| </ul> |