Special thanks and credit for the UH-1H Iroquois cockpit image goes to photographer: “[Rob Neil.Pacific Wings] @ Pixstel”.

cyberIP Reference

HTML

HTML5 Barebones Template

Need More? Use source code from: www.example.com

Need help with how to view source code?

Beginner’s HTML Cheat Sheet

CSS

HTML & CSS

Exploring Design

PHP localhost or online determination

  1. Using an absolute link will negate the base tag.
  2. Using this PHP code will negate the need to remove the localhost absolute link before uploading edited file.

When using the <base> tag you will have problems when editing on localhost. This php code will detect if you are on localhost or online. Using the ternary operator nothing is added to the relative link permiting the base link to be in effect. If you are using localhost the localhost absolute link that preceeds the relative link is automatically added.

Edit the absolute localhost linkshown in red as needed for your project!


            $serverName = $_SERVER['SERVER_NAME'];
            $host = $_SERVER['HTTP_HOST'];
            $linkPre = ($serverName != "localhost" && $host != "localhost") ? "" : "http://localhost/worldguruDETAILS/v3/RegionsNumericalList/altDesign/"; 
            

PHP Example of Dynamic Variables used in a For Loop

Output:

  1. The capital is: Islamabad and its country is: Pakistan
  2. The capital is: Kabul and its country is: Afghanistan
  3. The capital is: Ashgabat and its country is: Turkmenistan
  4. The capital is: Tashkent and its country is: Uzbekistan
  5. The capital is: Dushanbe and its country is: Tajikistan
  6. The capital is: Bishkek and its country is: Kyrgyzstan
  7. The capital is: Astana and its country is: Kazakhstan

Code:

<?php
/*
This illustrates using php dynamic variables in a for loop where each capital is contained in a numbered variable
and the countries are contained in an array.
The for loop access each capital using a dynamic variable where the changing for loop count (x+1) is combined with the static name part fo the variable (country)
*/
$stanCountries = array("Pakistan","Afghanistan","Turkmenistan","Uzbekistan","Tajikistan","Kyrgyzstan","Kazakhstan");

$arrlength = count($stanCountries);
$country1 = "The capital is: Islamabad";
$country2 = "The capital is: Kabul";
$country3 = "The capital is: Ashgabat";
$country4 = "The capital is: Tashkent";
$country5 = "The capital is: Dushanbe";
$country6 = "The capital is: Bishkek";
$country7 = "The capital is: Astana";

echo "<ol>";
for($x = 0; $x < $arrlength; $x++ ) {
echo '<li>'.${"country".($x+ 1)}.' and its country is: '. $stanCountries[$x].'</li>';
}
echo "</ol>";
?>

SVG

Basic SVG Document Template

Copy and Paste the code in red into a blank page and save with the ".svg" extension:

<?xml version="1.0" ?>
<DOCTYPE! svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
    "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg width="400" height="170" version="1.1"
    xmlns="http://www.w3.org/2000/svg">
<title>svg Circle Example</title>
<decs>Example of a Circle</desc>
<circle cx="200" cy="95" r="50" style="stroke:black; fill:#ffffcc;" />
</svg>

To produce this:svgExample.svg

SVG Inline Style Example

<svg width="400" height="170"> <circle cx="200" cy="95" r="50" style="stroke:blue; stroke-width: 3px; fill:#00ff00;" /> </svg>

SVG Internal Style Sheet Example

  <style type="text/css"> <![CDATA[
     circle {
       stroke: blue;
       stroke-width: 3px;
       fill: #ccccff;
     }
     rect {
       stroke: black;
       stroke-width: 3px;
       fill: #ff0000;
     }
  ]]></style>

SVG External Style Sheet Example

   <xml-stylesheet href="externalStyleSheet.css" type="text/css"/>
     circle {
       stroke: blue;
       stroke-width: 3px;
       fill: #ccccff;
     }

     rect {
       stroke: black;
       stroke-width: 3px;
       fill: #ff0000;
     }

     line {
       stroke: red;
       stroke-width: 3px;
       fill: #ffffff;
     }

Javascript

jQuery

  1. jQuery Home Page
    • jQuery UI
    • jQuery hotlink for latest:
      • <script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>
      • Use a local download in your working directory to work offline:
        • <script type="text/javascript" src="jquery.min.js"></script>
    • Let Me Google That For You
  2. jQuery w3schools
  3. jQuery udemy lecture (paid content)
  4. Learn and Master jQuery (another excellent resource!)
  5. jQuery Plugins

to test if the jQuery variable exists

Place this code within the body
of your html document:

<script type="text/javascript">
if (typeof jQuery != "undefined") {
alert('jQuery is installed!');
} else {
alert('jQuery is not installed!');
}
</script>

Bootstrap

Mac Stuff

Using localhost with macOS Sierra

After purchasing a new macbook Air and setting up Apache Server and PHP5 I could not access subdirectories under Sites. Google searches didnot turn up anything useful and easy until I located this link by John Foderaro:

How to Set up Apache in macOS Sierra 10.12

A mighty big thank you to you John Foderaro for a very well written and easy to follow guide! Bravo!

Terminal Macros

  1. Open Terminal
  2. ls -a
  3. find: ".bash_profile" near top of files listed.
  4. nano .bash_profile (to edit file and add new macros)
  5. Custom Command Example
    • customCommandName(){
      • cd /Users/yourUserNameHere/pathToDesiredDirectoryHere/DesiredDirectoryNameHere
      • ls
    • }
  6. ^X Exit (which is "ctrl X" after you are done editing.)
  7. y (yes to Save modified buffer)
  8. File Name to Write .bash_profile (simply press enter to accept given name .bash_profile)
  9. Then you should exit and quit Terminal to make new commands functional the next time you open terminal.

The custom command name is what you type into terminal to execute your command.

cd means Change Directory. It is followed by the path to the desired directory.

ls means to list all the files contained in the desired directory.

The advantage of this is you do not have to continually type in a long path name every time you want to go to the desired directory. Simply type the short custom command name and you are there! Listing the files is simply a bonus.

Using Terminal to Wildcard Rename Batch Files

Note: It is a good idea to copy and save somewhere all files you want to rename.

In terminal navigate to the directory that holds the files you want to rename. Then do the following steps in order:

  1. zsh
    • starts the zsh shell
  2. autoload -U zmv
  3. alias mmv='noglob zmv -W'
  4. mmv r36*.png r37*.png
    • will rename all r36 png files to r37 png files. The * represents the parts of the files that differ.
  5. exit
    • exits out of the zsh shell

more info about zsh

Regular Expressions

Regular Expressions provide a powerful time saving text searching mechanism if you are adept at using them. If you are not adept at using them, they can be frustrating.

These are two of my favorite resources for becoming adept with using Regular Expressions:

  1. RegexOne: a great online interactive Tutorial
    • When I worked through RegexOne's tutorials I found it useful to check the solutions even when I solved the task.
  2. Udemy: The Complete Regular Expressions Course
    • Note: This course is not free, but is often offered at a significant discount. If you really want or need to get up to speed fast with Regular Expressions, this course can easily be well worth your time.

Amazon Alexa

I had difficuly getting Alexa to start a book over from the beginning. Finally, this worked:

Commands:

  1. Alexa! Read my Kindle Book "bookTitle"!
    • This got her reading my Kindle Book from the last location.
  2. Alexa! go to the beginning!
    • Finally... It was like pulling teeth to get here.

I thought I had done this previously without success. I will have to try it again!

再见!