Skip to content

Instantly share code, notes, and snippets.

View mikestratton's full-sized avatar

Mike Stratton mikestratton

View GitHub Profile
@mikestratton
mikestratton / word-search.php
Created March 4, 2022 03:11
Incomplete solution for Leetcode Word Search
<?php
// https://leetcode.com/problems/word-search/
function exist($board, $word) {
// count width
$x = count($board[0]);
// count height
$y = 0;
@mikestratton
mikestratton / BusinessProfileController.php
Created January 17, 2022 08:41
GIS Function within Laravel Controller
public function geoCoding($zip_code){
$api = 'https://maps.googleapis.com/maps/api/geocode/json?address=';
$par = '&key=';
$goo = env('GOOGLE_KEY');
$url = $api . $zip_code . $par . $goo;
$file = file_get_contents($url);
$json = json_decode($file, true);
$lat = $json['results'][0]['geometry']['location']['lat'];
public function store(DefinitionsCreateRequest $request)
{
$input = $request->all();
$input['surveyor_id'] = Auth::id();
$quantity = $request->input('quantity');
$samples = 0;
if($quantity <= 999){
$samples = 3;
@mikestratton
mikestratton / freecodecamp-pomodoro-clock.markdown
Created February 16, 2021 01:54
freeCodeCamp: Pomodoro Clock

freeCodeCamp: Pomodoro Clock

Objective: Build a CodePen.io app that is functionally similar to this: https://codepen.io/FreeCodeCamp/full/aNyxXR/.

Fulfill the below user stories. Use whichever libraries or APIs you need. Give it your own personal style.

  • User Story: I can start a 25 minute pomodoro, and the timer will go off once 25 minutes has elapsed.
  • User Story: I can reset the clock for my next pomodoro.
  • User Story: I can customize the length of each pomodoro.

A Pen by Mike Stratton on CodePen.

@mikestratton
mikestratton / index.html
Created November 1, 2019 07:10
Simonwep pickr, Bind with input
<head>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@simonwep/pickr/dist/themes/nano.min.css" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@simonwep/pickr/dist/pickr.es5.min.js"></script>
</head>
<body>
@mikestratton
mikestratton / vim_cheatsheet.md
Created September 20, 2019 05:02 — forked from awidegreen/vim_cheatsheet.md
Vim shortcuts

Introduction

  • C-a == Ctrl-a
  • M-a == Alt-a

General

:q        close
:w        write/saves
:wa[!]    write/save all windows [force]
:wq       write/save and close
<?php
namespace App\Http\Controllers;
use App\Floor;
use App\Location;
use App\Photo;
use App\Property;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
<?php
//MySQL Database Connect
include 'dataconnect.php';
$wp_posts = "wp_posts";
$sql = "SELECT * FROM " . $wp_posts;
$result = $conn->query($sql);
if ($result->num_rows > 0) {
@mikestratton
mikestratton / lattice_multiplication.php
Created April 18, 2019 14:53
Lattice Multiplication Algorithm to Multiply Extremely Large Numbers in the Browser
<?php
// NOT COMPLETE YET!
//<li>Store number1 and number2 as variables (num1, num2)</li>
echo '<p>Store number1 and number2 as variables: <br>';
$numX = $_POST["numX"];
$numY = $_POST["numY"];
echo $numX . '<br>' . $numY . '</p>';
// <li>num1 and num2 toArray</li>
echo '<p>Number 1 and number 2 as array: <br>';
@mikestratton
mikestratton / Environmental Assessment Software
Created April 18, 2019 14:48
Environmental Assessment Software
/*
This function store results of a technicians work for
an EPA regulated firm. The technician would login and
calculate the square footage(with roof area includes
Pythagorean theorem) using a javascript calculator. He
would then enter the value found and save. The square
footage found would then define then number of samples
necessary for the EPA tech to take.
...
*/