Skip to content

Instantly share code, notes, and snippets.

Avatar

Bryan Focht bfocht

View GitHub Profile
@bfocht
bfocht / wordpress-ubuntu.sh
Last active Nov 4, 2021
Install WordPress on ubuntu, PHP71 , apache, mysql, configure WordPress, wp-cli, phpUnit, WP Coding standards, letsencrypt
View wordpress-ubuntu.sh
#!/bin/bash
#set your servername and email here
SERVERNAME=
EMAIL=
mkdir /wpinstall
cd /wpinstall
#generate password for mysql
@bfocht
bfocht / install-wordpress.sh
Last active Jan 26, 2021
install wordpress on openstack vm
View install-wordpress.sh
#!/bin/bash
# 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/php54.off
mv /etc/httpd/conf.modules.d/10-php.conf /etc/httpd/conf.modules.d/10-php54.off
@bfocht
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)){
fs.mkdirSync(dest);
}
if (fs.existsSync(dest+'index.js')){
View Github Pages.md

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:

View react-workshop.md

React WorkShop

Link to Slides

Install Create React App

npm install -g create-react-app

Create chat client

@bfocht
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 = "https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
// ... give time for script to load, then type (or see below for non wait option)
setTimeout(function(){
$ = 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" );
View wp-core-install.sh
#####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=$USER@godaddy.com
wp theme install primer --activate
chown -R apache:apache /var/www/html/*
@bfocht
bfocht / readprogressdumps.py
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
View readprogressdumps.py
#!/usr/bin/python
#Example usage
#python readprogressdumps.py -i city.bd -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"