@ WordPress project root directory
$ curl -OL https://raw.githubusercontent.com/poststatus/wptest/master/wptest.xml
$ wp import wptest.xml --authors=create
export PATH="$PATH:/Applications/DevDesktop/tools" | |
export PS1='\[\033[33;1m\]\w\[\033[m\]\$ ' | |
export CLICOLOR=1 | |
export LSCOLORS=ExFxBxDxCxegedabagacad | |
alias ls='ls -GFh' | |
export PATH=${PATH}:/usr/local/mysql/bin | |
export PATH=/usr/local/php5/bin:$PATH |
// Sync local database with prod | |
// <in uiowa703/docroot> | |
drush @<alias>.local sql-drop | |
drush sql-sync @<alias>.prod @<alias>.local | |
// Sync local uploaded files with prod | |
drush rsync @<alias>.prod:%files @<alias>.local:%files | |
// OR | |
drush @source.env rsync -A @self:%files @destination.env:%files |
function disable_ga_trackers() { | |
console.log('disabling trackers'); | |
ga(function() { | |
var trackers = ga.getAll(); | |
for (i = 0, len = trackers.length; i < len; i += 1) { | |
var trackerID = trackers[i].get('trackingId'); | |
console.log(trackerID); | |
var dis_trackerID = 'ga-disable-' + trackerID; | |
window[dis_trackerID] = true; | |
console.log(dis_trackerID); |
// stop git ask for passphrase | |
ssh-add -K |
* Core Control (outdated) - https://wordpress.org/plugins/core-control/ | |
* WP Debug Bar - https://wordpress.org/plugins/debug-bar/ |
// visually hide | |
.hide-accessibly { | |
position: absolute !important; | |
opacity: 0; | |
pointer-events: none; | |
} |
import { useState, useEffect } from "react"; | |
/* H/T: | |
Avoiding Race Conditions and Memory Leaks in React useEffect | |
https://javascript.plainenglish.io/avoiding-race-conditions-and-memory-leaks-in-react-useeffect-2034b8a0a3c7 | |
*/ | |
interface IUseFetchWithAbortResponse { | |
fetchedData: unknown; | |
isLoading: boolean; |
import React, { useState } from 'react'; | |
import ReactPaginate from 'react-paginate'; #New | |
const NewsCard = (props) => { | |
return ( | |
<div style={{ padding: '20' }}> | |
<a href={props.url}> | |
{props.title} by {props.author} | |
</a> | |
</div> |