Skip to content

Instantly share code, notes, and snippets.

View constructor-s's full-sized avatar

Bill constructor-s

View GitHub Profile
@constructor-s
constructor-s / PrintPDF.ahk
Created March 26, 2020 19:54
AutoHotKey to print current page to PDF in browser
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
^j::
Click
Sleep, 500
Send, ^p
Sleep, 1000
@constructor-s
constructor-s / README.md
Created February 14, 2023 16:35
Rule of Three Substitution

Build and run instructions:

>javac Substitution.java

>java Substitution < input.txt
Rules:
AA AB
AB BB
inkscape %1 --export-filename %1.emf
pause
@constructor-s
constructor-s / ping_until_success_and_echo_bell.bat
Created May 22, 2022 14:12
A bat script to keep pinging a target until success and echo the BELL character
@echo off
:repeat
ping 1.1.1.1 -n 1 || goto :repeat
echo Success!
echo 
pause
@constructor-s
constructor-s / HtmlToPDF.java
Last active January 18, 2022 00:37
Visual Field CSS Pattern Test
package com.example;
import com.itextpdf.html2pdf.HtmlConverter;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
/**
@constructor-s
constructor-s / hitron_router.py
Created August 7, 2020 11:10
Hitron router API, API version 1.11, Software Version 7.1.1.32, Python script for getting sysinfo, reboot
import logging
import requests
import json
from urllib.parse import urlunparse
from getpass import getpass
from argparse import ArgumentParser
parser = ArgumentParser("Hitron router API, API version 1.11, Software Version 7.1.1.32")
parser.add_argument("-u", "--username", type=str, default="cusadmin")
parser.add_argument("-p", "--password", type=str)
javascript:window.location.href="https://myaccess.library.utoronto.ca/login?url=" + window.location.href;
; RDP Wrapper Library configuration
; Do not modify without special knowledge
[Main]
Updated=2019-08-03
LogFile=\rdplog.txt
SLPolicyHookNT60=1
SLPolicyHookNT61=1
@constructor-s
constructor-s / mpl_deserialize.bat
Last active May 29, 2021 04:33
Quick preview and export of Matplotlib Figure pickles
call conda activate
python mpl_deserialize.py %1 --preview
@constructor-s
constructor-s / option.py
Last active April 12, 2021 00:33
Black Scholes Merton option with only Python standard library (Work in progress)
from math import sqrt, erf, pi, exp, log
N = lambda x: (1.0 + erf(x / sqrt(2.0))) / 2.0
phi = lambda x: exp(-0.5*x*x)/sqrt(2.0*pi)
class Option:
def __init__(self, St, K, t, s, r=0, q=0):
self.St = St # 0.90
self.K = K # 1.00
self.s = s # 0.20