Skip to content

Instantly share code, notes, and snippets.

View EvansWinner's full-sized avatar

Evans Winner EvansWinner

View GitHub Profile
@EvansWinner
EvansWinner / fake_acpi.ps1
Last active January 16, 2024 03:39
Quick get battery status on Windows Powershell command line
# I am used to typing "acpi" at the command line in Linux to see
# what my battery status is. I'm sure acpi does all kinds of other
# useful stuff, but that's what I am used to having. Here
# is something to do the same in Windows Powershell calling
# out to the wmic program. I have it it my $profile file.
# Also uses findstr and a list of output code meaning I found on
# Stackexchange or somewhere.... (Sorry, don't remember where.)
function acpi{
// Banish the mouse cursor in MS Windows from the keyboard
// This is meant to be like the function of the same name
// in Stumpwm, which I miss. You compile it, put it somewhere,
// then create a shortcut to it and put the SHORTCUT on your
// desktop, then in the shortcut properties, select a keyboard
// shortcut.
// I don't even know Csharp, really but figured out enough to do
// this with some judicious Googling.
""" Generate a quasi-random (temp!) password that is easy to communicate
and remember, consisting of one capitalized longish word and one numeral.
"""
from random import randint
# words file from
# https://raw.githubusercontent.com/first20hours/google-10000-english/master/google-10000-english-usa-no-swears-long.txt
path='C:/Users/ewinner/h/pwgen/words' # <== change this to your path....
@EvansWinner
EvansWinner / floating_message.py
Created February 9, 2021 16:04
Make a message float up the screen from random places in Python -- amuse children!
from time import sleep
from random import randint
import os
MESSAGE: str = "The helicoprion"
COLS: int
ROWS: int
COLS, ROWS = os.get_terminal_size()
SPARSENESS: int = 12
SPEED: float = 0.1 # Smaller is faster
@EvansWinner
EvansWinner / auction.py
Created July 12, 2019 15:59
Little eBay auction simulation using simpy.
"""
Simulate listing items on ebay
"""
import simpy, random, math
NUMBER_OF_ITEMS = 3000 # Number of items available to be acutioned
AUCTION_DURATION = 7 * 24 * 60 # One week of minutes
SIM_TIME = AUCTION_DURATION * 3 # Number of auction durations to run the sim
REVENUE = 0 # Running count of revenue
env = simpy.Environment()
#Persistent
;;; refresh-notes.ahk --- intermittantly refresh Lotus Notes while idle
;; It turns out that Notes' auto-refresh only works with your
;; own mailbox. It won't work with a shared inbox, like
;; the one we use where I work for work tickets.
;; Constants
n := 20 ; how often to send the key in seconds
window := "IBM Notes"
;; Banish mouse. Inspired by my beloved stumpwm
;; that I can't use on Windows at work. Re-bind
;; to the key of your choice.
#^b::MouseMove, A_ScreenWidth, A_ScreenHeight, 0