Skip to content

Instantly share code, notes, and snippets.

Matt Slay mattslay

Block or report user

Report or block mattslay

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@mattslay
mattslay / SunEnergyThatHitsTheEarth.md
Last active Sep 14, 2019
What percentage of the Sun's energy hits the Earth
View SunEnergyThatHitsTheEarth.md
@mattslay
mattslay / AnotherBubbleSortExample.cs
Last active Sep 14, 2019
Another Bubble Sort example in C#
View AnotherBubbleSortExample.cs
// Taken from: https://www.c-sharpcorner.com/blogs/bubble-sort-algorithm-in-c-sharp
using System;
class BubbleSort {
static void Main(string[] args) {
Console.WriteLine("Enter the Size of Array");
int size = int.Parse(Console.ReadLine()); //Read array size.
Console.WriteLine("Enter the Array elements");
@mattslay
mattslay / BubbleSort.cs
Last active Sep 14, 2019
Bubble Sort example in C#
View BubbleSort.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace BubbleSort
{
class Program
{
@mattslay
mattslay / query software installed on list of machines.ps1
Created Oct 19, 2018
PowerShell - Query software installed on list of machines
View query software installed on list of machines.ps1
$machines = 'MSPC5', 'JRPC5', 'CWPC5', 'RPPC5', 'TMPC4', 'MIPC5', 'TWPC5', 'JBPC5', 'DNC2', 'FS6-VM1', '192.168.0.60'
foreach ($machine in $machines)
{
trap{"$machine`: not reachable or not running WsMan"; continue}
if(test-wsman -ComputerName $machine -ea stop){
$result = gcim -Class CIM_Product -Filter 'Name like "%DWG%"' |
select name, version
Write-Host $machine $result.name, $result.version
@mattslay
mattslay / quickmove.js
Created Dec 7, 2017
Thunderbird Quick Folder Move
View quickmove.js
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
* Portions Copyright (C) Philipp Kewisch, 2009-2013 */
"use strict";
try {
Components.utils.import("resource:///modules/gloda/suffixtree.js");
} catch (e) {
View Extract scripts from SQL Server.ps1
# Adapted from here https://www.simple-talk.com/blogs/powershell-script-all-objects-on-all-databases-to-files/
# Also see this one: https://gist.github.com/cheynewallace/9558179
<# This simple PowerShell routine scripts out all the user-defined functions,
stored procedures, tables and views in all the databases on the server that
you specify, to the path that you specify.
SMO must be installed on the machine (it happens if SSMS is installed)
To run – set the servername and path. Open a command window and run powershell
@mattslay
mattslay / msUtils.prg
Last active Oct 17, 2016
Matt Slay general FoxPro utils, aka msUtils
View msUtils.prg
*=======================================================================================
Functions:
AddCR
AddSpace
AddWorkingDays
BuildHtmlPage
cd
CloseCursor
ConvertTimeStringToDecmalHours
ConveretoDate
View beginning_python.py
import math
class cylinder(object):
feature_type = "cylinder"
def __init__(self, diameter, length):
self.diameter = diameter
self.length = length
self._start_z = 0.00
@mattslay
mattslay / Index.md
Last active Jun 27, 2016
Basic getting started with html and javascript.md
View Index.md

This a small collection of getting-started-with-html-and-javascript samples that I created for coding beginners. Each link takes you to a code page hosted on jsFiddle where you can see the html/javascript code and how it renders on the screen. You can also play with the code in the jsFiddle editor to begin your own exploration and tinkering with html/javascript.


(Look for comments on each example in the lower javascript panel of the jsFiddle page.)

[00.0 - Basic HTML web page layout] (https://jsfiddle.net/mattslay/eq03yybz/)

  • the most basic sections of an html page: DOCTYPE, html, body

[00.1 - Introducing a few basic HTML elements] (https://jsfiddle.net/mattslay/9t4g5h4p/)

  • h1, h2, p, strong, em, u
@mattslay
mattslay / gist:46629f1f645d76800c4d
Created Feb 3, 2015
Asp.Net MVC controller pattern for typical CRUD actions
View gist:46629f1f645d76800c4d
namespace {{lcControllersNameSpace}}
{
[Authorize]
public class {{lcClassPlural}}Controller : {{lcAppBaseController}}
{
[HttpGet, Route("{{lcClassPlural}}")]
public ActionResult List()
{
var model = CreateViewModel<{{lcViewModelClass}}>();
You can’t perform that action at this time.