TLDR: Use for...of
instead of forEach()
in asynchronous code.
For legacy browsers, use for(...;...;...)
or [].reduce()
To execute the promises in parallel, use Promise.all([].map(...))
// Here is a basic Framer X component where we use CSS directly | |
import * as React from "react"; | |
import { PropertyControls, ControlType } from "framer"; | |
// Define type of property | |
interface Props { | |
width: number | |
height: number | |
} |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | |
<meta http-equiv="X-UA-Compatible" content="ie=edge"> | |
<title>Document</title> | |
</head> |
Benar Salah | |
Allah Alloh | |
Alquran Al Qur'an | |
Alquran Al-Qur'an | |
Alquran Al-Quran | |
Asar Azhar | |
Buddha Buda | |
Buddha Budha | |
Februari February | |
Februari Pebruari |
const waitFor = (ms) => new Promise(r => setTimeout(r, ms)) | |
const asyncForEach = async (array, callback) => { | |
for (let index = 0; index < array.length; index++) { | |
await callback(array[index], index, array) | |
} | |
} | |
const start = async () => { | |
await asyncForEach([1, 2, 3], async (num) => { | |
await waitFor(50) |
import React, { Component } from 'react' | |
import { RootNavigator } from './navigators' | |
import { GoogleAnalyticsTracker } from './utils/analytics' | |
import { GA_TRACKING_ID } from './constants' | |
class App extends Component { | |
// gets the current screen from navigation state | |
getCurrentRouteName = (navigationState) => { | |
if (!navigationState) { | |
return null |
const nativeMax = Math.max; | |
const nativeMin = Math.min; | |
function debounce(func, wait, options) { | |
let lastArgs, | |
lastThis, | |
maxWait, | |
result, | |
timerId, | |
lastCallTime, | |
lastInvokeTime = 0, |
104.16.119.221 boards.4chan.org | |
104.16.59.249 i.4cdn.org |
Create React App does not provide watching build mode oficially (#1070).
This script provides watching build mode for an external tool such as Chrome Extensions or Firebase app.
Create a React app.
Put the script into scripts/watch.js
.
Free O'Reilly Design Books and convenient script to just download them.
HUGE thanks to O'Reilly for making this resource free. Visit the design page if you want to learn more about the design resources. Also, they do have FREE resources for other topics like: Data, IoT, Programming, Security, Web Development, and WebOps.
Thanks @augbog for the initial gist. If you are a developer or looking for software engineering books, headover to the source of this fork.
How to use:
download.sh
file and put it into a directory where you want the files to be saved.cd
into the directory and make sure that it has executable permissions (chmod +x download.sh
should do it)