Skip to content

Instantly share code, notes, and snippets.


Bryan Focht bfocht

View GitHub Profile
View Github

GitHub Pages

Note: this feature is available with react-scripts@0.2.0 and higher.

Step 1: Add homepage to package.json

The step below is important!
If you skip it, your app will not deploy correctly.

Open your package.json and add a homepage field:


React WorkShop

Link to Slides

Install Create React App

npm install -g create-react-app

Create chat client

bfocht / postbuild.js
Last active Mar 2, 2019
post build script for create-react-app to move the js to a dist folder
View postbuild.js
const fs = require('fs');
const file = require('./build/asset-manifest.json')['main.js'];
const src = './build/';
const dest = './dist/';
if (!fs.existsSync(dest)){
if (fs.existsSync(dest+'index.js')){
bfocht / Update PL Data.js
Created Aug 18, 2017
Update the PL Data in the Reseller Control Center
View Update PL Data.js
var jq = document.createElement('script');
jq.src = "";
// ... give time for script to load, then type (or see below for non wait option)
$ = jQuery.noConflict();
$( "<style>#myContainer {position: absolute;top: 250px;left:50px; width:500px;border:3px outset black;margin:5px; opacity:0.9; z-index: 2202;padding: 50px 20px; } #myButton {cursor: pointer;}#myContainer p {color:red;background:white;}</style>" ).appendTo( "head" );
bfocht /
Last active Nov 4, 2021
Install WordPress on ubuntu, PHP71 , apache, mysql, configure WordPress, wp-cli, phpUnit, WP Coding standards, letsencrypt
#set your servername and email here
mkdir /wpinstall
cd /wpinstall
#generate password for mysql
#####run this script to automatically install
sudo su
cd /var/www/html
wp core install --url=$HOSTNAME --title="reseller store" --admin_user=bryan --admin_email=$
wp theme install primer --activate
chown -R apache:apache /var/www/html/*
bfocht /
Last active Jan 26, 2021
install wordpress on openstack vm
# install lamp server with PHP 7.2
yum -y install centos-release-scl.noarch
yum -y install rh-php72 rh-php72-php rh-php72-php-gd rh-php72-php-mbstring rh-php72-php-intl rh-php72-php-pecl-apcu rh-php72-php-fpm
yum -y install httpd mariadb-server svn rh-php72-php-mysqlnd
# disable loading the old PHP Apache modules by changing their names
mv /etc/httpd/conf.d/php.conf /etc/httpd/conf.d/
mv /etc/httpd/conf.modules.d/10-php.conf /etc/httpd/conf.modules.d/
bfocht /
Last active Aug 29, 2015
Script that will extract a ProgressDB binary dump file and convert it to a comma separate file. Tested on v8.3
#Example usage
#python -i -o city.csv -b 3,4,14,16,23 -p 36 -h branch,city-nm,city-no,entry-dt,entry-prsn,rte,state,tax-matl,tax-other,tax-serv,terr-no,tax-cd,area-cd,county-no,zip-cd,bill-to-only,low-zip,high-zip,estimator,salesman,technician,service-rep,service-area,CASS-city-nm,country,township-no,county-nm,township-nm,sales-rep
# -i input file is a binary dump file from Progress Software database
# -o output file
# -b columns that contain binary integers
# -p columns that contain packed decimals
# -h column headers (first row)
# --debug (make first row contain column number instead of column header
View create-site.ps1
param([string]$site=$(throw "Site argument is required."))
function vdir-exists([string]$name)
if((Test-Path -path $name) -eq $False)
return $False
(Get-Item $name).GetType().Name -eq "ConfigurationElement"