This file contains 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
// Depends | |
import React, { useState, useReducer, useEffect, useContext } from "react"; | |
// Define Store and initialState | |
const Store = React.createContext(null); | |
// Store Provider | |
export function StoreProvider({ children, reducer, initialState }) { | |
const [store, dispatch] = useReducer(reducer, initialState); | |
const [state, setState] = useState({ isLoaded: false }); |
This file contains 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
#!/bin/bash | |
COUNTER=1000 | |
while [ $COUNTER -lt 2000 ]; do | |
wget "https://earthview.withgoogle.com/download/$COUNTER.jpg" | |
let COUNTER=COUNTER+1 | |
done |
This file contains 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
var index, promise, _i; | |
for (index = _i = 0; _i < 10; index = ++_i) { | |
promise = (function(index) { | |
var dfd; | |
dfd = new $.Deferred(); | |
setTimeout(function() { | |
log(index); | |
return dfd.resolve(); |