Skip to content

Instantly share code, notes, and snippets.

View markvantilburg's full-sized avatar

mark van tilburg markvantilburg

View GitHub Profile
@markvantilburg
markvantilburg / ConfigureTimeServers.cmd
Created July 10, 2024 13:50
Configure Internet Time Servers Windows Server 2008/2012
net stop w32time
w32tm /config /syncfromflags:manual /manualpeerlist:"time-a.nist.gov, time-b.nist.gov, time-c.nist.gov, time-d.nist.gov"
w32tm /config /reliable:yes
net start w32time
@markvantilburg
markvantilburg / Convert Table to print dialog using JavaScript.html
Created June 28, 2024 15:02
Convert Table to print dialog using JavaScript
<html>
<head>
<title>Convert Table to print dialog using JavaScript</title>
<style>
table {
width: 300px;
}
table, th, td {
border: solid 1px #DDD;
border-collapse: collapse;
@markvantilburg
markvantilburg / array-in-session_application.asp
Created June 10, 2024 13:40
array-in-session_application.asp
'Storing and loading in Session:
Dim strPreviousAnswersDict(5,2)
strPreviousAnswersDict(1,1) = "s0"
strPreviousAnswersDict(1,2) = "banaan"
strPreviousAnswersDict(2,1) = "s1"
strPreviousAnswersDict(2,2) = "banaan"
Session("mark") = strPreviousAnswersDict
Dim objDict
@markvantilburg
markvantilburg / dictionary-in-session.asp
Created June 10, 2024 13:22
asp3 / asp classic - store dictionary in a session variable
<%
' How to store a Dictionary object in the Session
' Create the dictionary and add a value to it
Dim strPreviousAnswersDict
Set strPreviousAnswersDict=Server.CreateObject("Scripting.Dictionary")
strPreviousAnswersDict.Add "s1","banaan"
response.write strPreviousAnswersDict.Item("s1")
' Store the dictionary in the session
@markvantilburg
markvantilburg / split.ps1
Created January 9, 2024 11:35
Split outlook txt messages file into multiple files
$Path = "c:\temp\"
$InputFile= "c:\temp\mail.txt"
$Reader = New-Object System.IO.StreamReader($InputFile)
$i = 1
$OutputFile = "$i.txt"
While (($Line = $Reader.ReadLine()) -ne $null) {
If ($Line -match "From:\t") {
$OutputFile = "$i.txt"
$i++
}
@markvantilburg
markvantilburg / PadIpAddress.cs
Last active January 9, 2024 11:32
Pads an IP v4 address with extra 0's so we can use a simple calculation to figure out if the IP is in the range
/// <summary>
/// Pads an IP v4 address with extra 0's so we can use a simple calculation to figure out if the IP is in the range
/// 10.0.0.1 becomes 010.000.000.001
/// </summary>
/// <param name="text">IP address either IP v4 or IP v6</param>
/// <returns>The IP address padded with 0's if it's an IP v4 address. If it's an IP v6 address the initial value</returns>
public static string PadIpAddress(this string text)
{
// if there is no string or it's empty return an empty string
if (string.IsNullOrWhiteSpace(text))
@markvantilburg
markvantilburg / gist:011c5246ba016906510a
Created March 4, 2015 12:12 — forked from anonymous/gist:031e4d6161bb618ee1a0
Get an rss feed from github tags
e.g. for the following url
https://github.com/ariya/phantomjs/tags
to get this as an rss feed add .atom to the url
https://github.com/ariya/phantomjs/tags.atom
@markvantilburg
markvantilburg / index.html
Last active June 10, 2024 13:42 — forked from anonymous/index.html
Keycode logger
<html>
<body onKeyDown="doKey(event)" onKeyUp="doKey(event)">
whop whop
<div id="keydown"></div>
<script id="jsbin-javascript">
function doKey(e) {
evt = e || window.event; // compliant with ie6
document.getElementById('keydown').innerHTML = evt.keyCode+' Pressed';
}
</script>
<html><head><title></title></head>
<body>
<div id="id1"></div>
<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>
Inlined: https://raw.githubusercontent.com/digitalBush/jquery.maskedinput/1.4.0/dist/jquery.maskedinput.min.js
<script type="text/javascript">
/*
jQuery Masked Input Plugin
Copyright (c) 2007 - 2014 Josh Bush (digitalbush.com)
Licensed under the MIT license (http://digitalbush.com/projects/masked-input-plugin/#license)