Skip to content

Instantly share code, notes, and snippets.

@neorobin
neorobin / excelapp.py
Created August 10, 2024 06:17
Interacting with Microsoft Excel from Python using the Win32 COM API (Example Python Code)
"""
An example of using PyWin32 and the win32com library to interact
Microsoft Excel from Python.
This can be used instead of Visual Basic for Applications (VBA)
(c) Michael Papasimeon
"""
import win32com.client
@neorobin
neorobin / README.md
Last active June 9, 2023 16:50 — forked from caudamus/README.md
BNF Parser

BNF parsing

Toy weekend project: make a parser-parser!

This takes in a grammar given in Bakus-Naur Form (BNF), and a program that was written in the provided grammar, and produces an image of Syntax Tree using graphviz.

References:

@neorobin
neorobin / circle.py
Created September 9, 2022 08:29 — forked from lvrma/circle.py
Perfect circle to beat the game at https://vole.wtf/perfect-circle/ for absolutely no reason
import win32api, win32con, math
win32api.Sleep(10000)
start_x, start_y = win32api.GetCursorPos()
win32api.SetCursorPos((start_x,start_y))
for i in range(0, 320 * 2, 10):
x = start_x + int(300 * math.cos(float(i)/100.0))
y = start_y + int(300 * math.sin(float(i)/100.0))
win32api.SetCursorPos((x,y))
@neorobin
neorobin / QuickZip.vbs
Created October 7, 2021 02:36 — forked from simply-coded/QuickZip.vbs
Compress and decompress zip files in VBScript.
Function QuickZip(path)
'@description: Compress and uncompress zip files.
'@author: Jeremy England (SimplyCoded)
Dim oFso : Set oFso = CreateObject("Scripting.FileSystemObject")
Dim oSap : Set oSap = CreateObject("Shell.Application")
Dim oWss : Set oWss = CreateObject("WScript.Shell")
Dim isZip, count, root, base, add, out
Dim isZipping, isCancelable
Const NOT_FOUND = 1
Const NOT_A_ZIP = 2
@neorobin
neorobin / color-conversion-algorithms.js
Created November 4, 2020 04:02 — forked from mjackson/color-conversion-algorithms.js
RGB, HSV, and HSL color conversion algorithms in JavaScript
/**
* Converts an RGB color value to HSL. Conversion formula
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
* Assumes r, g, and b are contained in the set [0, 255] and
* returns h, s, and l in the set [0, 1].
*
* @param Number r The red color value
* @param Number g The green color value
* @param Number b The blue color value
* @return Array The HSL representation