Skip to content

Instantly share code, notes, and snippets.

View ddehart's full-sized avatar

Derek DeHart ddehart

View GitHub Profile
import React from 'react';
import {
render,
screen,
waitForElementToBeRemoved,
} from '@testing-library/react';
import { FetchProvider, useFetch } from '../fetch-context';
describe('FetchContext', () => {
import React, { createContext, useContext, useEffect, useState } from 'react';
import axios from 'axios';
import PropTypes from 'prop-types';
const FetchContext = createContext(undefined);
const { Provider } = FetchContext;
const FetchProvider = ({ children }) => {
const [csrfToken, setCsrfToken] = useState(null);
const [isLoading, setIsLoading] = useState(true);
@ddehart
ddehart / failing-build.log
Created November 28, 2020 23:44
65054965 - Failing build log
-----> Node.js app detected
-----> Creating runtime environment
NPM_CONFIG_LOGLEVEL=error
NODE_ENV=production
NODE_MODULES_CACHE=true
NODE_VERBOSE=false
-----> Installing binaries
@ddehart
ddehart / reference_array_test.php
Last active August 29, 2015 14:06
A simple test to describe behavior when housing references within an array
<?php
function returnReferenceArray($array)
{
foreach(array_keys($array) as $value)
{
$refs[] = &$array[$value];
}
return $refs;
}
@ddehart
ddehart / gist:e15bc58d24cdf29d873e
Created August 23, 2014 22:22
Sample, simple PSR-0 autoloading class for Bottom Oop
<?php
namespace Frend\Brainwork;
class AutoLoader
{
private $extension = ".php";
public function register()
{
spl_autoload_register(array($this,"includeClass"));