Skip to content

Instantly share code, notes, and snippets.

' Credit where it is due:
' http://computerperformance.co.uk/
' https://msdn.microsoft.com/en-us/library/aa394372(v=vs.85).aspx
' ----------------------------------------------------------------------
Option Explicit
Dim objWMIService, objShell, objProcess
Dim strComputer, colProcess, procName, procPath
procName = "notepad++.exe"
strComputer = "."
# Tomcat commands
Set-Variable -Name tomcat_path -Value "C:\path\to\apache-tomcat\bin\" -Scope global -Force
function start-tomcat {
$return_to = Get-Location
set-location -Path $tomcat_path
start-process .\startup.bat
Set-Location $return_to
}
<!DOCTYPE html>
<html>
<head>
<title>Calculator</title>
<script>
function checkSize() {
var html = document.documentElement;
var divC = document.getElementById("interface");
#!/usr/bin/perl -w
######################################################################
# skip_lines.pl -- skips selected lines of a given file
#
# perl skip_lines.pl /path/to/file.txt 1,3,4,5
# | | |
# script -----+ | |
# text file ---------------+ |
# comma separated line numbers ---------+
# with no spaces
<!DOCTYPE html>
<html>
<head>
<title>Weather Widget 1</title>
<script>
function getUrl() {
return "http://localhost:8080/scratch/weather.xml";
}
@andreburto
andreburto / clock.html
Last active August 23, 2020 23:19
Basic clock display
<!DOCTYPE html>
<html>
<head>
<title>Clock Widget 3</title>
<script>
var hour = 0;
var min = 0;
var sec = 0;
var year = 0;
var month = 0
<!DOCTYPE html>
<html>
<head>
<title>Polyglot</title>
<hta:application applicationname="Polyglot" scroll="no" singleinstance="no" />
<script type="text/vbscript">
Sub Window_onLoad
window.resizeTo 250,250
End Sub
function main{
Add-Type -AssemblyName presentationframework
$html = [string]@"
<!DOCTYPE html>
<html>
<head>
<title>Hello, World!</title>
<script>
# Query Yahoo!Weather to get the results. More can be gleaned than just the forecast.
function getWeather([string]$city, [string]$state){
$query = "select * from weather.forecast where woeid in (select woeid from geo.places(1) where text='{0}, {1}')"
$url = "https://query.yahooapis.com/v1/public/yql?q={0}&format=xml&env=store://datatables.org/alltableswithkeys"
$newQuery = $query -f $city, $state
$newUrl = $url -f $newQuery
[xml]$data = Invoke-RestMethod -Uri $newUrl
function main{
Add-Type -AssemblyName presentationframework
$xaml = [xml]@"
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Name="Window"
Title="MainWindow"
Width="640" Height="480">
<Grid x:Name="LayoutRoot">