text:
<repo_name>HellerCommaA/bitcoin-wp-e-commerce<file_sep>/src/merchants/bitcoin.php
<?php
/**
 * @file Bitcoin for the WP e-Commerce shopping cart plugin for WordPress
 * @author <NAME> - http://www.nostate.com/ http://www.gogulski.com/
 *
 * Donations: 1DcZfySDvUoNBzf2mwReVy3VL93WtwnALr
 */
/*
 * This is free and unencumbered software released into the public domain.
 *
 * Anyone is free to copy, modify, publish, use, compile, sell, or
 * distribute this software, either in source code form or as a compiled
 * binary, for any purpose, commercial or non-commercial, and by any
 * means.
 *
 * In jurisdictions that recognize copyright laws, the author or authors
 * of this software dedicate any and all copyright interest in the
 * software to the public domain. We make this dedication for the benefit
 * of the public at large and to the detriment of our heirs and
 * successors. We intend this dedication to be an overt act of
 * relinquishment in perpetuity of all present and future rights to this
 * software under copyright law.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 *
 * For more information, please refer to <http://unlicense.org/>
 */

$nzshpcrt_gateways[$num]['name'] = 'Bitcoin';
$nzshpcrt_gateways[$num]['internalname'] = 'bitcoin';
$nzshpcrt_gateways[$num]['function'] = 'gateway_bitcoin';
$nzshpcrt_gateways[$num]['form'] = "form_bitcoin";
$nzshpcrt_gateways[$num]['submit_function'] = "submit_bitcoin";
$nzshpcrt_gateways[$num]['payment_type'] = "credit_card";

add_filter("the_content", "bitcoin_checkout_complete_display_filter", 99);
add_filter("wp_mail", "bitcoin_checkout_complete_mail_filter", 99);
add_filter("cron_schedules", "bitcoin_create_cron_schedule", 10);
add_action("bitcoin_cron", "bitcoin_cron");

register_deactivation_hook(__FILE__ . DIRECTORY_SEPARATOR . "../wp-shopping-cart.php", "bitcoin_disable_cron");

/**
 * Set up a custom cron schedule to run every 5 minutes.
 *
 * Invoked via the cron_schedules filter.
 *
 * @param array $schedules
 */
function bitcoin_create_cron_schedule($schedules = '') {
  $schedules['every5minutes'] = array(
    'interval' => 300,
    'display' => __('Every five minutes'),
  );
  return $schedules;
}

/**
 * Cancel the Bitcoin processing cron job.
 *
 * Invoked at deactivation of WP e-Commerce
 */
function bitcoin_disable_cron() {
  wp_clear_scheduled_hook("bitcoin_cron");
}

function bitcoin_debug($message) {
  error_log($message);
}

/**
 * Cron job to process outstanding Bitcoin transactions.
 */
function bitcoin_cron() {
  /*
   * Find transactions where purchase status = 1 and gateway = bitcoin.
   * Bitcoin address for the transaction is stored in transactid
   */
  global $wpdb;
  bitcoin_debug("entering cron");
  $transactions = $wpdb->get_results("SELECT id,totalprice,sessionid,transactid,date FROM " . WPSC_TABLE_PURCHASE_LOGS . " WHERE gateway='bitcoin' AND processed='1'");
  if (count($transactions) < 1)
    return;
  bitcoin_debug("have transactions to process");
  include_once("library/bitcoin.inc");
  $bitcoin_client = new BitcoinClient(get_option("bitcoin_scheme"),
    get_option("bitcoin_username"),
    get_option("bitcoin_password"),
    get_option("bitcoin_address"),
    get_option("bitcoin_port"),
    get_option("bitcoin_certificate_path"));

  if (TRUE !== ($fault = $bitcoin_client->can_connect())) {
    error_log('The Bitcoin server is presently unavailable. Fault: ' . $fault);
    return;
  }
  bitcoin_debug("server reachable");
  foreach ($transactions as $transaction) {
    $address = $transaction->transactid;
    $order_id = $transaction->id;
    $order_total = $transaction->totalprice;
    $sessionid = $transaction->sessionid;
    $order_date = $transaction->date;
    bitcoin_debug("processing: " . var_export($transaction, TRUE));
    try {
      $paid = $bitcoin_client->query("getreceivedbyaddress", $address, get_option("bitcoin_confirms"));
    } catch (BitcoinClientException $e) {
      error_log("Bitcoin server communication failed on getreceivedbyaddress " . $address . " with fault string " . $e->getMessage());
      continue;
    }
    if ($paid >= $order_total) {
      bitcoin_debug("paid in full");
      // PAID IN FULL
      // Update payment log
      $wpdb->query("UPDATE " . WPSC_TABLE_PURCHASE_LOGS . " SET processed='2' WHERE id='" . $order_id . "'");
      // Email customer
      transaction_results($sessionid, false);
      continue;
    }
    if (time() > $order_date + get_option("bitcoin_timeout") * 60 * 60) {
      bitcoin_debug("order expired");
      // ORDER EXPIRED
      // Update payment log
      $wpdb->query("UPDATE " . WPSC_TABLE_PURCHASE_LOGS . " SET processed='5' WHERE id='" . $order_id . "'");
      // Can't email the customer via transaction_results
      // TODO: Email the customer, delete the order
    }
  }
  bitcoin_debug("leaving cron");
}

function bitcoin_checkout_complete_display_filter($content = "") {
  if (!isset($_SESSION['bitcoin_address_display']) || empty($_SESSION['bitcoin_address_display']))
    return $content;
  $cart = unserialize($_SESSION['wpsc_cart']);
  $content = preg_replace('/@@TOTAL@@/', $cart->total_price, $content);
  $content = preg_replace('/@@ADDRESS@@/', $_SESSION['bitcoin_address_display'], $content);
  $content = preg_replace('/@@TIMEOUT@@/', get_option('bitcoin_timeout'), $content);
  $content = preg_replace('/@@CONFIRMATIONS@@/', get_option('bitcoin_confirms'), $content);
  unset($_SESSION['bitcoin_address_display']);
  return $content;
}

function bitcoin_checkout_complete_mail_filter($mail) {
  if (!isset($_SESSION['bitcoin_address_mail']) || empty($_SESSION['bitcoin_address_mail']))
    return $mail;
  $cart = unserialize($_SESSION['wpsc_cart']);
  $mail['message'] = preg_replace('/@@TOTAL@@/', $cart->total_price, $mail['message']);
  $mail['message'] = preg_replace('/@@ADDRESS@@/', $_SESSION['bitcoin_address_mail'], $mail['message']);
  $mail['message'] = preg_replace('/@@TIMEOUT@@/', get_option('bitcoin_timeout'), $mail['message']);
  $mail['message'] = preg_replace('/@@CONFIRMATIONS@@/', get_option('bitcoin_confirms'), $mail['message']);
  unset($_SESSION['bitcoin_address_mail']);
  return $mail;
}

function bitcoin_checkout_fail($sessionid, $message, $fault = "") {
  global $wpdb;
  $wpdb->query("UPDATE " . WPSC_TABLE_PURCHASE_LOGS . " SET processed='5' WHERE sessionid=" . $sessionid);
  $_SESSION['WpscGatewayErrorMessage'] = $message;
  $_SESSION['bitcoin'] = 'fail';
  error_log($message . ": " . $fault);
  header("Location: " . get_option("checkout_url"));
}

/**
 * Process Bitcoin checkout.
 *
 * @param string $separator
 * @param integer $sessionid
 * @todo Document better
 */
function gateway_bitcoin($separator, $sessionid) {
  global $wpdb, $wpsc_cart;

  include_once("library/bitcoin.inc");
  $bitcoin_client = new BitcoinClient(get_option("bitcoin_scheme"),
    get_option("bitcoin_username"),
    get_option("bitcoin_password"),
    get_option("bitcoin_address"),
    get_option("bitcoin_port"),
    get_option("bitcoin_certificate_path"));

  if (TRUE !== ($fault = $bitcoin_client->can_connect())) {
    bitcoin_checkout_fail($session, 'The Bitcoin server is presently unavailable. Please contact the site administrator.', $fault);
    return;
  }

  $row = $wpdb->get_row("SELECT id,totalprice FROM " . WPSC_TABLE_PURCHASE_LOGS . " WHERE sessionid=" . $sessionid);
  $label = $row->id . " " . $row->totalprice;
  try {
    $address = $bitcoin_client->query("getnewaddress", $label);
  } catch (BitcoinClientException $e) {
    bitcoin_checkout_fail($session, 'The Bitcoin server is presently unavailable. Please contact the site administrator.', $e->getMessage());
    return;
  }
  if (!Bitcoin::checkAddress($address)) {
    bitcoin_checkout_fail($session, 'The Bitcoin server returned an invalid address. Please contact the site administrator.', $e->getMessage());
    return;
  }
  //var_dump($_SESSION);
  unset($_SESSION['WpscGatewayErrorMessage']);
  // Set the transaction to pending payment and log the Bitcoin address as its transaction ID
  $wpdb->query("UPDATE " . WPSC_TABLE_PURCHASE_LOGS . " SET processed='1', transactid='" . $address . "' WHERE sessionid=" . $sessionid);
  $_SESSION['bitcoin'] = 'success';
  $_SESSION['bitcoin_address_display'] = $address;
  $_SESSION['bitcoin_address_mail'] = $address;
  header("Location: " . get_option('transact_url') . $separator . "sessionid=" . $sessionid);
  exit();
}

/**
 * Set Bitcoin payment options and start the cronjob.
 * @todo validate values
 */
function submit_bitcoin() {
  $options = array(
    "bitcoin_scheme",
    "bitcoin_certificate_path",
    "bitcoin_username",
    "bitcoin_password",
    "bitcoin_port",
    "bitcoin_address",
    "bitcoin_timeout",
    "bitcoin_confirms",
    "payment_instructions",
  );
  foreach ($options as $o)
    if ($_POST[$o] != NULL)
      update_option($o, $_POST[$o]);
  wp_clear_scheduled_hook("bitcoin_cron");
  wp_schedule_event(time(), "every5minutes", "bitcoin_cron");
  return true;
}

/**
 * Produce the HTML for the Bitcoin settings form.
 */
function form_bitcoin() {
  global $wpdb;
  $bitcoin_scheme = (get_option('bitcoin_scheme') == '' ? 'http' : get_option('bitcoin_scheme'));
  $bitcoin_certificate_path = get_option('bitcoin_certificate_path');
  $bitcoin_username = get_option('bitcoin_username');
  $bitcoin_password = get_option('bitcoin_password');
  $bitcoin_address = (get_option('bitcoin_address') == '' ? 'localhost' : get_option('bitcoin_address'));
  $bitcoin_port = (get_option('bitcoin_port') == '' ? '8332' : get_option('bitcoin_port'));
  $bitcoin_timeout = (get_option('bitcoin_timeout') == '' ? '72' : get_option('bitcoin_timeout'));
  $bitcoin_confirms = (get_option('bitcoin_confirms') == '' ? '0' : get_option('bitcoin_confirms'));
  if (get_option('payment_instructions') != '')
    $payment_instructions = get_option('payment_instructions');
  else {
    $payment_instructions = 'Please send your payment of BTC @@TOTAL@@ to Bitcoin address @@ADDRESS@@. ';
    $payment_instructions .= 'If your payment is not received within @@TIMEOUT@@ hour(s) with at least @@CONFIRMATIONS@@ network confirmations, ';
    $payment_instructions .= 'your transaction will be canceled.';
  }

  // Create the Bitcoin currency if it doesn't already exist
  $sql = "SELECT currency FROM " . WPSC_TABLE_CURRENCY_LIST . " WHERE currency='Bitcoin'";
  if (!$wpdb->get_row($sql)) {
    $sql = "INSERT INTO " . WPSC_TABLE_CURRENCY_LIST . " VALUES (NULL, 'Bitcoin', 'BC', 'Bitcoin', '', '', 'BTC', '0', '0', 'antarctica', '1')";
    $wpdb->query($sql);
  }

  $output = "

			Connection data for your bitcoin server HTTP-JSON-RPC interface.

			Server scheme (HTTP or HTTPS)
			<input type='text' size='40' value='"
    . $bitcoin_scheme . "' name='bitcoin_scheme' />

			SSL certificate path
			<input type='text' size='40' value='"
    . $bitcoin_certificate_path . "' name='bitcoin_certificate_path' />

			Server username
			<input type='text' size='40' value='"
    . $bitcoin_username . "' name='bitcoin_username' />

			Server password
			<input type='text' size='40' value='"
    . $bitcoin_password . "' name='bitcoin_password' />

			Server address (usually localhost)
			<input type='text' size='40' value='"
    . $bitcoin_address . "' name='bitcoin_address' />

			Server port (usually 8332)
			<input type='text' size='40' value='"
    . $bitcoin_port . "' name='bitcoin_port' />

			Transaction timeout (hours)
			<input type='text' size='40' value='"
    . $bitcoin_timeout . "' name='bitcoin_timeout' />

			Transaction confirmations required
			<input type='text' size='40' value='"
    . $bitcoin_confirms . "' name='bitcoin_confirms' />

				Enter the template for payment instructions to be give to the customer on checkout.

				<textarea cols='40' rows='9' name='wpsc_options[payment_instructions]'>"
    . $payment_instructions . "</textarea>

    			Valid template tags:

@@TOTAL@@ - The order total

@@ADDRESS@@ - The Bitcoin address generated for the transaction

@@TIMEOUT@@ - Transaction timeout (hours)

@@CONFIRMATIONS@@ - Transaction confirmations required

				Like Bitcoin for WP e-Commerce? Your gifts to 1DcZfySDvUoNBzf2mwReVy3VL93WtwnALr are greatly appreciated. Thank you!

	";
  return $output;
}
?>

repo_language: PHP

repo_name: HellerCommaA/bitcoin-wp-e-commerce


text:
<file_sep>---
type: podcast
title: Software Engineering Daily
subtitle: software
layout: default
modal-id: 200
date: 2019-01-01
img: sed_logo_updated.png
thumbnail: sed_logo_updated.png
alt: image-alt
project-date: 2019-01-01
client: Start Bootstrap
category: Web Development
description: A small podcast that covers a broad range of software related subjects.
link: https://softwareengineeringdaily.com/category/podcast/
---
<file_sep>module.exports = {
  siteTitle: 'Hi, I\'m Al, nice to meet you!',
  siteDescription: `Project Portfolio written in React and Gatsby`,
  siteFaviocon: './images/favicon.ico',
  keyWords: ['gatsbyjs', 'react'],
  authorName: '<NAME>',
  twitterUsername: 'apiepho1',
  githubUsername: 'alpiepho',
  authorAvatar: './images/avatar.jpeg',
  authorDescription: [
    'I am a problem solver, looking for a position developing Software or Firmware that has an impact.',
    'With a very strong background in Embedded Systems, I contiunue to expand my skills in Python and Web development.',
    'I am a true self-starter and just love to learn new things.'
  ],
  jobs: [
    {
      company: "'Learning Sabbatical'",
      begin: {
        month: 'jun',
        year: '2019'
      },
      duration: null,
      occupation: "Web Development",
      description: "Taking time to spend with family and prepare for career pivot to Mobile and Web Application development."

    },
    {
      company: "Danaher (Hach)",
      begin: {
        month: 'dec',
        year: '2017'
      },
      duration: '1 yr & 8 mos',
      occupation: "Firmware Engineer",
      description: "Developement of firmware for water analyzers. Built full-stack prototype IOT system for industrial field controllers."

    },
    {
      company: "Broadcom",
      begin: {
        month: 'jan',
        year: '2013'
      },
      duration: '3 yr & 4 mos',
      occupation: "Firmware Engineer",
      description: "Designed and implemented very low level, efficient FW for several SERDES (serialize/deserialize) ASICs used in very high speed computer interfaces such as Ethernet, SAS/SATA.."
    },
    {
      company: "Schneider Electric (Pelco)",
      begin: {
        month: 'jun',
        year: '2008'
      },
      duration: '4 yr & 7 mos',
      occupation: "Software Engineer",
      description: "Embedded software for digital video cameras.  Integrated third party video analytics SW into existing digital video camera. Developed embedded web application for video recorder.",
    },
    {
      company: "Hewlett-Packard",
      begin: {
        month: 'jan',
        year: '2003'
      },
      duration: '5+ yr',
      occupation: "Software Engineer",
      description: "Developed FW for several digital cameras. Local expert in key areas: performance and embedded code/memory usage. Reduced effective camera boot time from 5 seconds to under 1 second. Designed SW simulator for DSP image processing engine of 2 competing ASICS, allowing direct porting of key algorithms between platforms."
    },
    /* ... */
  ],
  projects: [
    {
      title: "Simple Score VB (PWA)",
      begin: {
        month: 'aug',
        year: '2019'
      },
      type: "personal",
      image: "./images/screenshot-vb-pwa.png",
      link: "https://github.com/alpiepho/simple-score-volleyball-pwa/",
      description: "A Gatsby-based PWA to score Volleyball with and option to send text message, using Netlify Lambda and Twilio on the backend."
    },
    {
      title: "20 Patterns PWA",
      begin: {
        month: 'aug',
        year: '2019'
      },
      type: "personal",
      image: "./images/screenshot-gitprime-patterns.png",
      link: "https://alpiepho.github.io/gitprime-patterns/",
      description: "From my first Gatsby Starter.  A review of GitPrime 20 Patterns e-book as a PWA."
    },
    {
      title: "Terms PWA Starter",
      begin: {
        month: 'aug',
        year: '2019'
      },
      type: "personal",
      image: "./images/screenshot-terms-pwa-starter.png",
      link: "https://alpiepho.github.io/terms-pwa-starter/",
      description: "My first Gatsby Starter.  A Gatsby starter for a PWA that shows a list of terms and other details about the terms."
    },
    {
      title: "Any Counter",
      begin: {
        month: 'aug',
        year: '2019'
      },
      type: "personal",
      image: "./images/screenshot-any-counter.png",
      link: "https://alpiepho.github.io/any-counter/",
      description: "Converted LeetCode algorithm into simple Progressive Web App (PWA), with perfect LightHouse scores!"

    },
    {
      title: "Site Evaluations",
      begin: {
        month: 'aug',
        year: '2019'
      },
      type: "personal",
      image: "./images/screenshot-site-eval.png",
      link: "https://alpiepho.github.io/site-evaluation-all/",
      description: "Followup on an idea to use a handful of developer tools to create complementory site evaluation reports.  Good way to learn more about various websites."

    },
    {
      title: "My Blog",
      begin: {
        month: 'aug',
        year: '2019'
      },
      type: "personal",
      image: "./images/screenshot-my-blog.png",
      link: "https://alpiepho.github.io/my-blog2/",
      description: "Started a personal blog using React/Gatsby.  Original setup and deploy took about an hour!"

    },
    {
      title: "State of Development Force Graph - PWA",
      begin: {
        month: 'jul',
        year: '2019'
      },
      type: "personal",
      image: "./images/screenshot-state-pwa.png",
      link: "https://alpiepho.github.io/state-web-development-2018-2019-withD3-pwa/",
      description: "A PWA (Progressive Web App) using D3 to show data from the 'State of Javascript 2018' and 'State of CSS 2019'"

    },
    {
      title: "State of Development Force Graph - Static",
      begin: {
        month: 'jul',
        year: '2019'
      },
      type: "personal",
      image: "./images/screenshot-state-static.png",
      link: "https://alpiepho.github.io/state-web-development-2018-2019-withD3-static/",
      description: "A static page using D3 to show data from the 'State of Javascript 2018' and 'State of CSS 2019'"

    },
    {
      title: "Baseball Stats Gather/View",
      begin: {
        month: 'jul',
        year: '2019'
      },
      type: "personal",
      image: "./images/screenshot-react-stats-bsb.png",
      link: "https://alpiepho.github.io/react-stats-bsb/",
      description: "Web crawler using Puppeteer/Headless Chrome along with a React site to view stats."

    },
    {
      title: "Water anaylsis",
      begin: {
        month: 'tbd',
        year: '2019'
      },
      type: "work",
      image: "./images/firmware-sc200.jpeg",
      description: "Developed firmware for pending water analysis controllers and sensors."

    },
    {
      title: "VS Code Plugin",
      begin: {
        month: 'may',
        year: '2019'
      },
      type: "personal",
      image: "./images/screenshot-rpn-hex-vscode.png",
      link: "https://marketplace.visualstudio.com/items?itemName=thatnamegroup.rpn-hex-calc",
      description: "RPN Hex Calculator VS Code Extension (Published to Microsoft Marketplace)"

    },
    {
      title: "Chrome Extension",
      begin: {
        month: 'apr',
        year: '2019'
      },
      type: "personal",
      image: "./images/screenshot-rpn-hex-chrome.png",
      link: "https://chrome.google.com/webstore/detail/rpn-hex-calculator/koffmhlebmnnlgdlgfkpiglpfgjlkcmc",
      description: "RPN Hex Calculator Chrome Extension (Published to Chrome Store)"

    },
    {
      title: "CSS Challenge",
      begin: {
        month: 'jul',
        year: '2017'
      },
      type: "personal",
      image: "./images/screenshot-purecss.png",
      link: "https://codepen.io/collection/DYpQdK/",
      description: "CSS Challenge to create complex graphics with just HTML and CSS. Have completed all 50. So amazing what is possible with just CSS!"

    },
    {
      title: "SERDES products",
      begin: {
        month: 'dec',
        year: '2016'
      },
      type: "work",
      image: "./images/firmware-broadcom-sas-sata-controller.jpg",
      description: "Design, implement and debug very time and size limited firmware for several SerDes products used in high data rate serial computer interfaces."

    },
    {
      title: "Digital Video",
      begin: {
        month: 'jan',
        year: '2008'
      },
      type: 'work',
      image: "./images/firmware-pelco-sarix_1.jpg",
      description: "Developed embedded software for internet based digital security cameras including low level components."
    }
  ],
  podcasts: [
    {
      type: 'software',
      title: 'Software Engineering Daily',
      description: 'A small podcast that covers a broad range of software related subjects.',
      image: 'https://softwareengineeringdaily.com/wp-content/uploads/2015/08/sed_logo_updated.png',
      link: 'https://softwareengineeringdaily.com/category/podcast/'
    },
    {
      type: 'security',
      title: 'Cyberwire',
      description: 'Cyber sercurity news.',
      image: 'https://thecyberwire.com/images/navLogo.png',
      link: 'https://thecyberwire.com/podcasts'
    },
    {
      type: 'python',
      title: 'Python Bytes',
      description: '"Python Headlines delivered to your Earbugs". (and some decent/bad Dad jokes)',
      image: 'https://pythonbytes.fm/static/img/logo.png?cache_id=391cb49247369a67c4be78b27f2b3cd5',
      link: 'https://pythonbytes.fm/'
    },
    {
      type: 'life',
      title: 'Akimbo',
      description: 'A podcast by <NAME>, random insights on life.',
      image: './images/akimbo.png',
      link: 'https://www.akimbo.me/'
    },
    {
      type: 'history',
      title: 'Commandline Heros',
      description: 'An original podcast about the people who transform technology from the command line up.',
      image: 'https://alpiepho.github.io/project-portfolio2/images/screenshot-commandline-heros.png',
      link: 'https://www.redhat.com/en/command-line-heroes'
    },
    {
      type: 'opinion',
      title: 'Intellegence Squared',
      description: 'Addresses a fundamental problem in America: the extreme polarization of our nation and our politics.',
      image: 'https://www.intelligencesquaredus.org/sites/default/files/iq2logo.png',
      link: 'https://www.intelligencesquaredus.org/podcasts?gclid=Cj0KCQiAhKviBRCNARIsAAGZ7CeomoQ8Vmn5exl03jzlhBEMGMy9TRPToWF5PdD8tf-8sVIGFDXY1HMaAvpNEALw_wcB'
    }
  ],
  social: {
    twitter: "https://twitter.com/apiepho1",
    linkedin: "https://www.linkedin.com/in/al-piepho-fw-sw-engineer/",
    github: "https://github.com/alpiepho",
    email: "<EMAIL>",
    resume: "./images/ResumeAlPiepho_public.pdf",
    blog: "https://alpiepho.github.io/my-blog"
  },
  siteUrl: 'https://alpiepho.github.io/project-portfolio2',
  pathPrefix: '/project-portfolio2', // Note: it must *not* have a trailing slash.
  siteCover: './images/cover2.jpg',
  googleAnalyticsId: 'UA-142308652-1',
  background_color: '#ffffff',
  theme_color: '#25303B',
  display: 'minimal-ui',
  icon: 'src/assets/gatsby-icon.png',
  headerLinks: [
    {
      label: 'Al Piepho - SW | FW | Web',
      url: '/',
    }
  ],
  footer: {
    text: 'Previous can be found at: ',
    link: 'https://alpiepho.github.io/project-portfolio1/',
    label: 'Version 1 in HTML/JS/CSS'
  }
}
<file_sep>---
type: project
title: CSS Challenge
subtitle: personal
layout: default
modal-id: 112
date: 2017-07-13
img: screenshot-purecss.png
thumbnail: screenshot-purecss--thumbnail.png
alt: image-alt
project-date: 2017-07-13
client: Start Bootstrap
category: Web Development
description: CSS Challenge to create complex graphics with just HTML and CSS. Have completed all 50. So amazing what is possible with just CSS!
link: https://codepen.io/collection/DYpQdK/
---
<file_sep>---
type: project
title: VS Code Plugin
subtitle: personal
layout: default
modal-id: 110
date: 2019-05-11
img: screenshot-rpn-hex-vscode.png
thumbnail: screenshot-rpn-hex-vscode--thumbnail.png
alt: image-alt
project-date: 2019-05-11
client: Start Bootstrap
category: Web Development
description: RPN Hex Calculator VS Code Extension (Published to Microsoft Marketplace)
link: https://marketplace.visualstudio.com/items?itemName=thatnamegroup.rpn-hex-calc
---
<file_sep>---
type: project
title: Chrome Extension
subtitle: personal
layout: default
modal-id: 111
date: 2019-04-12
img: screenshot-rpn-hex-chrome.png
thumbnail: screenshot-rpn-hex-chrome--thumbnail.png
alt: image-alt
project-date: 2019-04-12
client: Start Bootstrap
category: Web Development
description: RPN Hex Calculator Chrome Extension (Published to Chrome Store)
link: https://chrome.google.com/webstore/detail/rpn-hex-calculator/koffmhlebmnnlgdlgfkpiglpfgjlkcmc
---
<file_sep>---
type: podcast
title: Akimbo
subtitle: life
layout: default
modal-id: 203
date: 2019-01-04
img: akimbo.png
thumbnail: akimbo--thumbnail.png
alt: image-alt
project-date: 2019-01-04
client: Start Bootstrap
category: Web Development
description: A podcast by <NAME>, random insights on life.
link: https://www.akimbo.me/
---
<file_sep>
var site = require('./siteConfig')
const fs = require('fs')

// console.log("")
// console.log("site.jobs: ")
// console.log("
")
// let i
// for (i=0; i<site.jobs.length; i++) {
//     let job = site.jobs[i]
//     console.log("
")
//     // console.log("
")
//     // console.log("    ")
//     // console.log("
")
//     console.log("
")
//     console.log("
")
//     console.log("
" + job.company + "
")
//     console.log("
" + job.begin.month.toUpperCase() + " " + job.begin.year + "
")
//     console.log("
" + (job.duration ? job.duration.toUpperCase() : "PRESENT") + "
")
//     console.log("
" + job.occupation + "
")
//     console.log("
")
//     console.log("
")
//     console.log("
" + job.description + "
")
//     console.log("
")
//     console.log("
")
//     console.log("
")
// }
// // console.log("
")
// // console.log("
")
// // console.log("
The")
// // console.log("
Next")
// // console.log("
Chapter?
")
// // console.log("
")
// // console.log("
")
// console.log("
")
// console.log("")

// let fake_day = 1
// function getMonthNumber(s) {
//     if (s === 'jan') return '01'
//     if (s === 'feb') return '02'
//     if (s === 'mar') return '03'
//     if (s === 'apr') return '04'
//     if (s === 'may') return '05'
//     if (s === 'jun') return '06'
//     if (s === 'jul') return '07'
//     if (s === 'aug') return '08'
//     if (s === 'sep') return '09'
//     if (s === 'oct') return '10'
//     if (s === 'nov') return '11'
//     if (s === 'dec') return '12'
//     return '01'
// }

// for (i=0; i<site.projects.length; i++) {
//     let project = site.projects[i]

//     let filename = ''
//     let datestring = ''
//     datestring += project.begin.year
//     datestring += '-'
//     datestring += getMonthNumber(project.begin.month)
//     datestring += '-'
//     datestring += fake_day
//     filename += datestring
//     fake_day += 1
//     filename += '-project-'
//     filename += i+1
//     filename += '.markdown'

//     let content = ''
//     content += '---\n'
//     content += 'type: project\n'
//     content += 'title: ' + project.title + '\n'
//     content += 'subtitle: ' + project.type + '\n'
//     content += 'layout: default\n'
//     content += 'modal-id: ' + (i+100) + '\n'
//     content += 'date: ' + datestring + '\n'
//     let image = project.image.replace('./images/', '')
//     console.log('cp ~/Projects/gatsby/project-portfolio2/static/images/' + image + ' ../img/portfolio')
//     let thumb = image
//     thumb = thumb.replace('.jpeg', '--thumbnail.jpeg')
//     thumb = thumb.replace('.jpg', '--thumbnail.jpg')
//     thumb = thumb.replace('.png', '--thumbnail.png')

//     console.log('cp ~/Projects/gatsby/project-portfolio2/static/images/' + image + ' ../img/portfolio/' + thumb)

//     content += 'img: ' + image + '\n'
//     content += 'thumbnail: ' + thumb + '\n'
//     content += 'alt: image-alt\n'

//     content += 'project-date: ' + datestring + '\n'

//     content += 'client: '
//     content += 'Start Bootstrap'
//     content += '\n'

//     content += 'category: Web Development\n'

//     content += 'description: ' + project.description + '\n'

//     content += 'link: ' + project.link + '\n'

//     content += '---\n'

//     //console.log('# ' + filename + '...')
//     fs.writeFileSync(filename, content)
// }

let fake_day = 1
function getMonthNumber(s) {
    if (s === 'jan') return '01'
    if (s === 'feb') return '02'
    if (s === 'mar') return '03'
    if (s === 'apr') return '04'
    if (s === 'may') return '05'
    if (s === 'jun') return '06'
    if (s === 'jul') return '07'
    if (s === 'aug') return '08'
    if (s === 'sep') return '09'
    if (s === 'oct') return '10'
    if (s === 'nov') return '11'
    if (s === 'dec') return '12'
    return '01'
}

for (i=0; i<site.podcasts.length; i++) {
    let podcast = site.podcasts[i]

    let filename = ''
    let datestring = ''
    datestring += '2019' //podcast.begin.year
    datestring += '-'
    datestring += '01' //getMonthNumber(podcast.begin.month)
    datestring += '-'
    datestring += fake_day
    filename += datestring
    fake_day += 1
    filename += '-podcast-'
    filename += i+1
    filename += '.markdown'

    let content = ''
    content += '---\n'
    content += 'type: podcast\n'
    content += 'title: ' + podcast.title + '\n'
    content += 'subtitle: ' + podcast.type + '\n'
    content += 'layout: default\n'
    content += 'modal-id: ' + (i+200) + '\n'
    content += 'date: ' + datestring + '\n'
    let image = podcast.image.replace('./images/', '')
    console.log('cp ~/Projects/gatsby/project-portfolio2/static/images/' + image + ' ../img/portfolio')
    let thumb = image
    thumb = thumb.replace('.jpeg', '--thumbnail.jpeg')
    thumb = thumb.replace('.jpg', '--thumbnail.jpg')
    thumb = thumb.replace('.png', '--thumbnail.png')

    console.log('cp ~/Projects/gatsby/project-portfolio2/static/images/' + image + ' ../img/portfolio/' + thumb)

    content += 'img: ' + image + '\n'
    content += 'thumbnail: ' + thumb + '\n'
    content += 'alt: image-alt\n'

    content += 'project-date: ' + datestring + '\n'

    content += 'client: '
    content += 'Start Bootstrap'
    content += '\n'

    content += 'category: Web Development\n'

    content += 'description: ' + podcast.description + '\n'

    content += 'link: ' + podcast.link + '\n'

    content += '---\n'

    //console.log('# ' + filename + '...')
    fs.writeFileSync(filename, content)

}

// type: 'history',
// title: 'Commandline Heros',
// description: 'An original podcast about the people who transform technology from the command line up.',
// image: 'https://alpiepho.github.io/project-portfolio2/images/screenshot-commandline-heros.png',
// link: 'https://www.redhat.com/en/command-line-heroes'
<file_sep>---
type: podcast
title: Commandline Heros
subtitle: history
layout: default
modal-id: 204
date: 2019-01-05
img: screenshot-commandline-heros.png
thumbnail: screenshot-commandline-heros.png
alt: image-alt
project-date: 2019-01-05
client: Start Bootstrap
category: Web Development
description: An original podcast about the people who transform technology from the command line up.
link: https://www.redhat.com/en/command-line-heroes
---
<file_sep>---
type: project
title: Water Anaylsis
subtitle: work
layout: default
modal-id: 109
date: 2019-11-10
img: firmware-sc200.jpeg
thumbnail: firmware-sc200--thumbnail.jpeg
alt: image-alt
project-date: 2019-10-10
client: Start Bootstrap
category: Web Development
description: Developed firmware for pending water analysis controllers and sensors.
link: undefined
---
<file_sep>---
type: project
title: Digital Video
subtitle: work
layout: default
modal-id: 114
date: 2019-10-01
img: firmware-pelco-sarix_1.jpg
thumbnail: firmware-pelco-sarix_1--thumbnail.jpg
alt: image-alt
project-date: 2008-01-15
client: Start Bootstrap
category: Web Development
description: Developed embedded software for internet based digital security cameras including low level components.
link: undefined
---
<file_sep>---
type: podcast
title: Intellegence Squared
subtitle: opinion
layout: default
modal-id: 205
date: 2019-01-06
img: iq2logo.png
thumbnail: iq2logo.png
alt: image-alt
project-date: 2019-01-06
client: Start Bootstrap
category: Web Development
description: "Addresses a fundamental problem in America, the extreme polarization of our nation and our politics."
link: "https://www.intelligencesquaredus.org/podcasts?gclid=Cj0KCQiAhKviBRCNARIsAAGZ7CeomoQ8Vmn5exl03jzlhBEMGMy9TRPToWF5PdD8tf-8sVIGFDXY1HMaAvpNEALw_wcB"
---
<file_sep>---
type: project
title: Simple Score VB (PWA)
subtitle: personal
layout: default
modal-id: 100
date: 2019-08-01
img: screenshot-vb-pwa.png
thumbnail: screenshot-vb-pwa--thumbnail.png
alt: image-alt
project-date: 2019-08-01
client: Start Bootstrap
category: Web Development
description: A Gatsby-based PWA to score Volleyball with and option to send text message, using Netlify Lambda and Twilio on the backend.
link: https://github.com/alpiepho/simple-score-volleyball-pwa/
---
<file_sep>
# Summary

Version 3 using 'Agency' template for Jekyll (server side using Ruby to generate static pages).

## Next Steps

- review all data
- link from port2
- change redirect

## Build Help

- bundle exec jekyll serve  # serve locally
- bundle exec jekyll build  # build and push to gh-pages

<file_sep>---
type: project
title: SERDES products
subtitle: work
layout: default
modal-id: 113
date: 2019-12-01
img: firmware-broadcom-sas-sata-controller.jpg
thumbnail: firmware-broadcom-sas-sata-controller--thumbnail.jpg
alt: image-alt
project-date: 2016-12-14
client: Start Bootstrap
category: Web Development
description: Design, implement and debug very time and size limited firmware for several SerDes products used in high data rate serial computer interfaces.
link: undefined
---
<file_sep>---
type: podcast
title: Python Bytes
subtitle: python
layout: default
modal-id: 202
date: 2019-01-03
img: pythonbytes.png
thumbnail: pythonbytes.png
alt: image-alt
project-date: 2019-01-03
client: Start Bootstrap
category: Web Development
description: Python Headlines delivered to your Earbugs. (and some decent/bad Dad jokes)
link: https://pythonbytes.fm/
---
<file_sep>---
type: podcast
title: Cyberwire
subtitle: security
layout: default
modal-id: 201
date: 2019-01-02
img: cyberwire.png
thumbnail: cyberwire.png
alt: image-alt
project-date: 2019-01-02
client: Start Bootstrap
category: Web Development
description: Cyber sercurity news.
link: https://thecyberwire.com/podcasts
---
<file_sep>url: https://alpiepho.github.io
baseurl: /project-portfolio3/

# Site settings
title: Hi, I'm Al
email: <EMAIL>
description: "Project Portfolio for Al Piepho written  with Jekyll.  Firmware, Software, Web."

# Team names, titles and social links
people:
- name: <NAME>
  pic: 1
  position: Firmware | Software | Web
  social:
    - title: linkedin
      url: https://www.linkedin.com/in/al-piepho-fw-sw-engineer/
    - title: github
      url: https://github.com/alpiepho

# Social networks usernames (many more available: google-plus, flickr, dribbble, pinterest, instagram, tumblr, linkedin, etc.)
social:
  - title: linkedin
    url: https://www.linkedin.com/in/al-piepho-fw-sw-engineer/
  - title: twitter
    url: https://twitter.com/apiepho1
  - title: github
    url: https://github.com/alpiepho
  - title: envelope
    url: mailto:<EMAIL>
  - title: book
    url: https://alpiepho.github.io/my-blog2

# Postal address (add as many lines as necessary)
# address:
#   - line: 3481 Melrose Place
#   - line: Beverly Hills, CA 90210

# Build settings
markdown: kramdown
permalink: pretty
theme: jekyll-theme-tactile<file_sep>### Tools

This directory contains data from the previous version of my portfolio, ie. a couple
.json files from that Gatsby site.  It also contains a simple node.js application to
convert that data to the form needed for this Jekyll template.

<file_sep>---
type: project
title: My Blog
subtitle: personal
layout: default
modal-id: 105
date: 2019-08-06
img: screenshot-my-blog.png
thumbnail: screenshot-my-blog--thumbnail.png
alt: image-alt
project-date: 2019-08-06
client: Start Bootstrap
category: Web Development
description: Started a personal blog using React/Gatsby.  Original setup and deploy took about an hour!
link: https://alpiepho.github.io/my-blog2/
---
<file_sep>---
type: project
title: PWA Presentation
subtitle: personal
layout: default
modal-id: 120
date: 2019-09-27
img: pwa-presentation_screenshot1.png
thumbnail: pwa-presentation--thumbnail.png
alt: image-alt
project-date: 2019-09-27
client: Start Bootstrap
category: Web Development
description: Build PWA for my PWA Presentation based on my own Gatsby Starter
link: https://alpiepho.github.io/pwa-presentation/
---

branch_name: refs/heads/master

languages: Markdown JavaScript YAML

repo_language: Markdown


text:
<repo_name>PraveenSkanda/Repository1<file_sep>/src/main/resources/ctp.properties
projectKey=a
clientId=a
clientSecret=a
authUrl=https://auth.sphere.io
apiUrl=https://api.sphere.io

repo_language: INI