Skip to content

Instantly share code, notes, and snippets.

View timothyshort's full-sized avatar

Tim Short timothyshort

View GitHub Profile
@timothyshort
timothyshort / XML.java
Created July 26, 2017 12:40
This function takes an XML file and returns the data as a double array
// Dependencies: javax.xml | org.w3c.com | org.xml.sax
public static String[][] get(String file) {
String[][] data = null;
// 1. Prepare Xpath
XPathFactory xpf = XPathFactory.newInstance();
XPath xPath = xpf.newXPath();
try {
// 2. Create XML File
@timothyshort
timothyshort / log4net.xml
Last active September 14, 2017 00:04
This is an XML configuration file for log4.net with App.config for C#.NET framework in Visual Studio
<configSections>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net"/>
</configSections>
<log4net debug="false">
<appender name="LogFileAppender" type="log4net.Appender.FileAppender,log4net">
<!-- Modify this value to define the location and name of log file -->
<param name="File" value="C:\Desktopt\TestLog.log"/>
<param name="AppendtoFile" value="true"/>
@timothyshort
timothyshort / VagrantfileNetwork.txt
Created January 27, 2018 04:03
Add this provisioning script to enable the network adapters for Vagrant / VirtualBox that will allow for SSH
config.vm.provider "virtualbox" do |vb|
### Change network card to PCnet-FAST III
# For NAT adapter
vb.customize ["modifyvm", :id, "--nictype1", "Am79C973"]
# For host-only adapter
vb.customize ["modifyvm", :id, "--nictype2", "Am79C973"]
end
@timothyshort
timothyshort / server.js
Last active January 27, 2018 05:13
Sample NodeJS application that can be deployed to a web server with NodeJS installed
var http = require('http');
// Configure our HTTP server to respond with Hello World to all requests.
var server = http.createServer(function (request, response) {
response.writeHead(200, {"Content-Type": "text/plain"});
response.end("This is my Node JS app");
});
// Listen on port 8666, IP defaults to 127.0.0.1
server.listen(8666);
pipeline {
agent any
parameters {
string(name: 'server', defaultValue: "C:\\HexawareTraining\\Cohort1\\JenkinsLabs\\apache-tomcat-")
string(name: 'emailTo', defaultValue: "[email protected]")
}
triggers {
@timothyshort
timothyshort / kill-browsers.bat
Created September 27, 2018 16:27
This Windows batch file kills all automated browser / drivers from leftover Selenium web automation
taskkill /IM geckodriver.exe /F
taskkill /IM IEDriverServer.exe /F
taskkill /IM chromedriver.exe /F