Skip to content

Instantly share code, notes, and snippets.

View earvinpiamonte's full-sized avatar

Noel Earvin Piamonte earvinpiamonte

  • Infor
  • Baguio City, Philippines
View GitHub Profile
@nico-martin
nico-martin / PostList.jsx
Last active August 8, 2022 18:21
useApi.jsx - the correct way to fetch data with react hooks: extension of https://dev.to/nicomartin/the-right-way-to-fetch-data-with-react-hooks-48gc
// ./PostList.jsx
import React from 'react';
import {apiStates, useApi} from './useApi.jsx'
const PostList = () => {
const { state, error, data, reload } = useApi('https://api.mysite.com');
switch (state) {
case apiStates.ERROR:
return (
@bradtraversy
bradtraversy / webdev_online_resources.md
Last active June 25, 2024 22:17
Online Resources For Web Developers (No Downloading)
@luckyshot
luckyshot / response.php
Last active December 30, 2019 16:02
Web scraping done right (with cUrl and user agent)
<?php return array (
'url' => 'https://xaviesteve.com/',
'content' => '<!doctype html><html>...</html>',
'cookies' => '__cfduid=d3fa669e1069e72c2e47d127ab9b8e11f1465390629',
'http_code' => 200,
'content_type' => 'text/html; charset=UTF-8',
'header_size' => 578,
'request_size' => 229,
'filetime' => -1,
'ssl_verify_result' => 0,