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 / 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', ''
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.version
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
* Portions Copyright (C) Philipp Kewisch, 2009-2013 */
"use strict";
try {
} catch (e) {
View Extract scripts from SQL Server.ps1
# Adapted from here
# Also see this one:
<# 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 / msUtils.prg
Last active Oct 17, 2016
Matt Slay general FoxPro utils, aka msUtils
View msUtils.prg
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 /
Last active Jun 27, 2016
Basic getting started with html and

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] (

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

[00.1 - Introducing a few basic HTML elements] (

  • h1, h2, p, strong, em, u
mattslay / gist:46629f1f645d76800c4d
Created Feb 3, 2015
Asp.Net MVC controller pattern for typical CRUD actions
View gist:46629f1f645d76800c4d
namespace {{lcControllersNameSpace}}
public class {{lcClassPlural}}Controller : {{lcAppBaseController}}
[HttpGet, Route("{{lcClassPlural}}")]
public ActionResult List()
var model = CreateViewModel<{{lcViewModelClass}}>();
mattslay / gist:03a09ec1911fba88a03b
Last active Aug 29, 2015
Helpful Sql Server scripts
View gist:03a09ec1911fba88a03b
-- See lots of settings the DB is currently using
select * from sys.databases
-- Count rows in each table
select TableName, i.rows Records
from sysobjects t, sysindexes i
where t.xtype = 'U' and = and i.indid in (0,1)
order by Records desc;
-- Find Foreign Key References
mattslay / bootstrap.rb
Created Jul 30, 2012 — forked from allard/bootstrap.rb
Form builder for Twitter Bootstrap v2 form elements
View bootstrap.rb
# This file goes in config/initializers
require 'bootstrap_form_builder'
# Make this the default Form Builder. You can delete this if you don't want form_for to use
# the bootstrap form builder by default
ActionView::Base.default_form_builder = BootstrapFormBuilder::FormBuilder
# Add in our FormHelper methods, so you can use bootstrap_form_for.
ActionView::Base.send :include, BootstrapFormBuilder::FormHelper
mattslay / capybara_example.rb
Created Jun 11, 2012
My collection of Capybara examples
View capybara_example.rb
# This is an example of various ways I use Capybara to test the Submit button on my crud forms.
# I am using these tests to:
# 1. Confirm the form has a submit/commit button
# 2. Confirm that the submit/commit button has a particular css class ('btn-primary' from twitter bootstrap)
# 3. Confirm that the displayed value (or caption, if you will) of the submit/commit says "Save"
# Given this html inside of a form tag:
# <input class="btn btn-primary" id="submit" name="commit" type="submit" value="Save" />
You can’t perform that action at this time.