Skip to content

Instantly share code, notes, and snippets.

View bfocht's full-sized avatar

Bryan Focht bfocht

View GitHub Profile
@bfocht
bfocht / X10 Server
Created June 30, 2023 01:27
X10 Registration Codes
if (httpRequest.Uri.AbsolutePath.Equals("/xregister.cgi"))
{
HTTPResponse.BodyData = "100: 127.0.0.1,127X0X0X1P0 registered successfully\n";
}
if (httpRequest.Uri.AbsolutePath.Equals("/cgi-bin/checkfornewrelease.cgi"))
{
//respMess = "<html>\n<head>\n<title>.</title>\n<meta http-equiv=\"Cache-Control\" content=\"no-cache\">\n</head>\n<body>\n<a href=\"http://www.x10.com/\">Click here</a> to continue.\n</body>\n</html>";
HTTPResponse.BodyData = "<xml>\n";
HTTPResponse.BodyData += "<activehomepro>\n";

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
bfocht / postbuild.js
Last active March 2, 2019 14:19
post build script for create-react-app to move the js to a dist folder
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')){
@bfocht
bfocht / wordpress-ubuntu.sh
Last active November 4, 2021 23:45
Install WordPress on ubuntu, PHP71 , apache, mysql, configure WordPress, wp-cli, phpUnit, WP Coding standards, letsencrypt
#!/bin/bash
#set your servername and email here
SERVERNAME=
EMAIL=
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=$USER@godaddy.com
wp theme install primer --activate
chown -R apache:apache /var/www/html/*
@bfocht
bfocht / install-wordpress.sh
Last active January 26, 2021 19:04
install wordpress on openstack vm
#!/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 / readprogressdumps.py
Last active August 29, 2015 14:07
Script that will extract a ProgressDB binary dump file and convert it to a comma separate file. Tested on v8.3
#!/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
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"