Skip to content

Instantly share code, notes, and snippets.

Michael Haufe mlhaufe

Block or report user

Report or block mlhaufe

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
@mlhaufe
mlhaufe / ShellBrowse.vbs
Last active Aug 5, 2019
VBScript File Browser
View ShellBrowse.vbs
Option Explicit
' Flags for the options parameter
Const BIF_returnonlyfsdirs = &H0001
Const BIF_dontgobelowdomain = &H0002
Const BIF_statustext = &H0004
Const BIF_returnfsancestors = &H0008
Const BIF_editbox = &H0010
Const BIF_validate = &H0020
Const BIF_browseforcomputer = &H1000
@mlhaufe
mlhaufe / parameters.vbs
Created Jun 19, 2011
VBScript class constructor parameters
View parameters.vbs
Class Person
Private m_Age
Private m_Name
Public Default Function Init(Name, Age)
m_Name = Name
m_Age = Age
Set Init = Me
End Function
@mlhaufe
mlhaufe / dom.wsf
Last active Sep 29, 2015
WSH Quick DOM
View dom.wsf
<job>
<script language="JScript">
var oDOM = WScript.GetObject("http://www.google.com");
do {
WScript.sleep(200);
} while(oDOM.readyState != "complete")
WScript.echo(oDOM.documentElement.outerHTML)
</script>
@mlhaufe
mlhaufe / rot13.js
Created Dec 29, 2011
JavaScript 1.5 cutesy rot13
View rot13.js
function rot13(c){
return c.replace(/([a-m])|([n-z])/ig, function($0,$1,$2){
return $1 ? String.fromCharCode($1.charCodeAt(0) + 13) :
$2 ? String.fromCharCode($2.charCodeAt(0) - 13) : $0; });
}
@mlhaufe
mlhaufe / permutation.js
Created Dec 29, 2011
JavaScript 1.5 Permutations
View permutation.js
var perm = (function(){
function perm(xs, ys, o){
if(ys.length){
for(var i=0,v;(v=xs+ys.charAt(i)),i<ys.length;i++){
o[v] = 1;
perm(v, ys.slice(0,i) + ys.slice(i + 1),o)
}
}
}
return function(ys){
@mlhaufe
mlhaufe / ANTParsing.ps1
Last active Nov 11, 2016
PowerShell ANT dependency parsing attempt [Abandoned]
View ANTParsing.ps1
set-psdebug -strict
cd C:\Users\-TNO-\Desktop\batik
$xml = get-content build.xml
$targets = $xml.selectNodes('/project/target')
$buildTargets = [Xml.XmlElement[]]$xml.selectNodes("//target[preceding-sibling::comment()[contains(.,'Build ..')]" +
" and " +
"following-sibling::comment()[contains(.,'Generates maven')]]")
$props = @{'${basedir}' = Get-Item .}
function antcall([Xml.XmlElement]$this,[HashTable]$tg){
@mlhaufe
mlhaufe / htmlTitleList.vbs
Created Jan 6, 2012
Getting html details (VBScript)
View htmlTitleList.vbs
'Reference: <http://www.visualbasicscript.com/tm.aspx?high=&m=95638&mpage=1>
Option Explicit
Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
Dim files : Set files = fso.GetFolder("C:\test\").Files
Dim file
For Each file In files
If file.Type = "Firefox Document" Then '<-- update for your system
Dim doc : Set doc = CreateObject("htmlfile")
doc.write fso.OpenTextFile(file.Path).ReadAll()
@mlhaufe
mlhaufe / fileType.js
Created Jan 6, 2012
Lookup known filetype (JScript)
View fileType.js
//Reference: <https://groups.google.com/group/comp.lang.javascript/browse_thread/thread/684ad16518c837a2/67d00aa5dbe854c2?show_docid=67d00aa5dbe854c2>
var listFileTypes = (function(){
var fso = new ActiveXObject("Scripting.FileSystemObject");
var shell = new ActiveXObject("WScript.Shell");
function isKnown(file){
var fName = file.Name;
//the rules of capitalization are strange in windows...
//there are rare cases where this can fail
//for example: .HKEY_CLASSES_ROOT\.HeartsSave-ms
@mlhaufe
mlhaufe / SendKeys.hta
Created Jan 9, 2012
SendKeys + Sleep + VBScript
View SendKeys.hta
<!doctype html>
<html>
<!--Reference <http://www.visualbasicscript.com/tm.aspx?high=&m=95682&mpage=1#95682> -->
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title>Send Keys</title>
<script type="text/vbscript">
Sub Sleep(intTimeWait)
Dim Shell : Set Shell = CreateObject("WScript.Shell")
Shell.Run "%comspec% /c ping.exe 127.0.0.1 -w 1000 -n " & _
View SEEK.hta
<!doctype html>
<html>
<!-- ref: <https://groups.google.com/group/comp.lang.javascript/browse_thread/thread/684ad16518c837a2/fbfd4c2610bc8832?show_docid=fbfd4c2610bc8832> -->
<head>
<meta charset="utf-8" />
<hta:application
applicationname="SEEK"
version="1.0">
<title>SEEK</title>
<style type="text/css">
You can’t perform that action at this time.