Skip to content

Instantly share code, notes, and snippets.

View breeze4's full-sized avatar

Matt Bailey breeze4

View GitHub Profile
@breeze4
breeze4 / speedtest.ps1
Created November 24, 2022 04:25
Powershell speedtest
# this is cribbed from here, but without the emailing - just prints out the results:
# https://community.spiceworks.com/scripts/show/4910-remotely-or-locally-run-a-speed-test-via-powershell
# https://www.speedtest.net/apps/cli
cls
$DownloadURL = "https://install.speedtest.net/app/cli/ookla-speedtest-1.0.0-win64.zip"
#location to save on the computer. Path must exist or it will error
$DOwnloadPath = "c:\temp\SpeedTest.Zip"
$ExtractToPath = "c:\temp\SpeedTest"
$SpeedTestEXEPath = "C:\temp\SpeedTest\speedtest.exe"
var module = angular.module('mySubModule', ['someModule']);
module.controller('MyController', ['someService', function MyController(someService) {
var self = this;
self.coolFun = function() {
self.someVar = 'x';
someService.otherFunction();
}
}]);
@breeze4
breeze4 / gist:7361db0d92ecbccf7769
Last active August 29, 2015 14:21
CQRS/Event Sourcing design pattern question
public enum Mode {
GROUND, AIR, OCEAN;
}
// *** GENERIC STYLE ***
// 1 command to set the mode
public SetModeCommand {
private final Mode mode;
// constructor, getters, etc
}
// handler:
String s = Paths.get("").toAbsolutePath().toString();
String newJsonFile = s.replace("\\", "/") + "/src/test/resources/" + jsonFile;
try (Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(newJsonFile), "utf-8"))) {
writer.write(json);
} catch (IOException ex) {
// handle me
}
@breeze4
breeze4 / studentclass
Created August 19, 2012 19:48
insaneclownkitty student
public class Student {
//declare variables that will be used
private String firstname;
private String lastname;
private int studentID;
private double[] projects;
private double[] quizzes;
public Student(String first, String last, int id) {
//instantiate variables with parameters from the constructor