#Web scrapers on the internet
See this repo to contribute/see more: https://github.com/cassidoo/scrapers
#Web scrapers on the internet
See this repo to contribute/see more: https://github.com/cassidoo/scrapers
I hereby claim:
To claim this, I am signing this object:
// Modified version of this Stack Overflow response: | |
// https://stackoverflow.com/a/48459005/1950503 | |
// (Removes ramda dependency, adds .trim() to string replacer, adds it to Jest global var instead of exporting) | |
// To use: | |
// Put `<rootDir>/path/to/customWhitespaceMatcher.js` in your Jest config under setupFiles | |
// Call it in your tests like this: | |
// expect( | |
// customMatchers.whitespaceMatcher(receivedResult, expectedResult).pass | |
// ).toBeTruthy(); |
import time | |
print "..." | |
time.sleep(1) | |
print "..." | |
print "..." | |
print "..." | |
print "..." | |
time.sleep(1) | |
print "..." |
const cities = [ | |
{ | |
city: "Abbeville", | |
state: "Louisiana", | |
}, | |
{ | |
city: "Aberdeen", | |
state: "Maryland", | |
}, | |
{ |
function useMedia(query) { | |
const [matches, setMatches] = useState(window.matchMedia(query).matches) | |
useEffect(() => { | |
const media = window.matchMedia(query) | |
if (media.matches !== matches) { | |
setMatches(media.matches) | |
} | |
const listener = () => { | |
setMatches(media.matches) |
export const SomeButton = forwardRef( | |
( | |
{ children, onSelect, ...props }, | |
forwardedRef | |
) => { | |
return ( | |
<button | |
{...props} | |
onClick={onSelect} | |
ref={forwardedRef} |
import { useEffect } from "react"; | |
import { useAppReducer } from "../AppContext"; | |
export default function useLocal() { | |
const dispatch = useAppReducer(); | |
useEffect(() => { | |
dispatch({ | |
type: "GET_FROM_LOCAL_STATE", | |
somePieceOfState: localStorage.getItem("some_state") || "defaultvalue", |
import React, { useState, useEffect, useReducer, useMemo } from 'react' | |
import ReactDOM from 'react-dom' | |
// let text = 'hellllooooo' | |
// I AM REACT | |
// let domTable = {} | |
// let element = Counter // state = 0 | |
// commit(element, domTable) |
export default function usePromise(api) { | |
const [state, dispatch] = useReducer( | |
(state, action) => { | |
switch (action.type) { | |
case 'LOADING': | |
return { ...state, loading: true } | |
case 'RESOLVED': | |
return { ...state, loading: false, response: action.response, error: null } | |
case 'ERROR': | |
return { ...state, loading: false, response: null, error: action.error } |