Skip to content

Instantly share code, notes, and snippets.

View mikestratton's full-sized avatar

Mike Stratton mikestratton

View GitHub Profile
@mikestratton
mikestratton / MyClass.java
Created May 19, 2015 05:26
Cheat Sheet for Java
//Single line comment
/* multiple
* line
* comment
*/
//import libraries
import java.util.Scanner;
import java.math.BigDecimal;
@mikestratton
mikestratton / git_simple
Last active August 29, 2015 14:23
Simple Git Command Instructions
Simple instructions to clone, push and pull Git content:
server <<<--->>> local system
To clone repository from Github to local system:
1. Open Git Bash
2. git clone <URL of Repository>
To add file or subdirectory to local Git (Record changes to repository)
1. Open Git Bash
2. cd <directory>
@mikestratton
mikestratton / gist:4a95a8b88f78713397b7
Last active September 5, 2015 07:14
Two Wordpress Menu Views: (Public and Logged in Users view different menus.)
function my_wp_nav_menu_args( $args = '' ) {
if( is_user_logged_in() ) {
$args['menu'] = 'menu-private';
} else {
$args['menu'] = 'menu-public';
}
return $args;
}
add_filter( 'wp_nav_menu_args', 'my_wp_nav_menu_args' );
?>
@mikestratton
mikestratton / lottery.php
Created January 12, 2016 08:52
Lottery algorithm based on Benford's Law that will make your rich!
<html>
<head>
<title>Lottery & Benfords Law</title>
</head>
<body style="margin:2% auto; text-align:center;">
<h1>Win the Lottery Using Benford's Law!</h1>
<p>This PHP page uses Benford's law to randomly generates numbers for the Powerball Lottery<br />
<a href="https://en.wikipedia.org/wiki/Benford%27s_law" target="_blank">Click here to learn more about Beford's Law<a/></p>
<h3>This generator increases your chances to win by approximately 30% !</h3>
<?php
@mikestratton
mikestratton / drawing-tools.html
Created October 21, 2016 02:18 — forked from Hagith/drawing-tools.html
Google Maps v3 Drawing Tools
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="UTF-8">
<title>Drawing Tools</title>
<script type="text/javascript"
src="http://maps.google.com/maps/api/js?sensor=false&libraries=drawing"></script>
<style type="text/css">
#map, html, body {
@mikestratton
mikestratton / index.html
Created October 21, 2016 02:21 — forked from knownasilya/index.html
Google Maps Advanced Drawing
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="initial-scale=1.0, user-scalable=no">
<meta charset="UTF-8">
<title>Drawing Tools</title>
<script type="text/javascript"
src="http://maps.google.com/maps/api/js?sensor=false&libraries=drawing"></script>
<style type="text/css">
#map, html, body {
<?php
decipherThis('72olle 103doo 100ya'); // 'Hello good day'
echo "<br />";
decipherThis('82yade 115te 103o'); // 'Ready set go'
echo "<br />";
decipherThis('a'); // 'a'
echo "<br />";
decipherThis('115da'); // 'sad'
echo "<br />";
@mikestratton
mikestratton / mortgage_payment_calculator.cpp
Created February 22, 2017 19:54
Mortgage Payment Calculator. This program determines the monthly payments on a mortgage given the loan amount, the yearly interest, and the number of years.
//*****************************************************************
// Mortgage Payment Calculator program
// This program determines the monthly payments on a mortgage given
// the loan amount, the yearly interest, and the number of years.
//*****************************************************************
#include // Access cout
#include // Access power function
#include // Access manipulators
using namespace std;
/** https://github.com/mikestratton/jquery-quiz **/
for(var i = 1; i <= 45; i++) { // loop radio buttons
var radios = document.getElementsByName('q'+i); //used to increment questions in html
for(var j = 0; j < radios.length; j++) {
var radio = radios[j];
if(radio.value == "1" && radio.checked) {
amountCorrect = amountCorrect + 1; //add radio value to total
}
}
}
@mikestratton
mikestratton / uiid.html
Created April 29, 2017 09:06
Embedded Google Assistant
<!DOCTYPE HTML>
<html>
<head>
<title>uiid virtual assistant</title>
</head>
<body>
<iframe width="350" height="430" src="https://console.api.ai/api-client/demo/embedded/cf3105b6-12b8-4047-8727-9dab8ec0d66a"></iframe>