Skip to content

Instantly share code, notes, and snippets.

View SYZYGY-DEV333's full-sized avatar

SYZYGY-DEV333 SYZYGY-DEV333

View GitHub Profile
@SYZYGY-DEV333
SYZYGY-DEV333 / pipeorganinfo.py
Created January 4, 2021 17:56
A really crude scraper for pipeorgandatabase.org
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Pipe Organ Database Stoplist Scraper
license = '''
Copyright 2021 Joshua Sobel
Permission is hereby granted, free of charge, to any person obtaining a copy of this software
and associated documentation files (the "Software"), to deal in the Software without restriction,
including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
@SYZYGY-DEV333
SYZYGY-DEV333 / hover.lua
Created July 17, 2020 22:10
A hover script for KSP using RedOnion
window=new(ui.Window,"Hover Dialog",ui.Layout.Vertical)
window.ChildAnchors=ui.Anchors.Fill
hovering = false
target_alt = 0
target_vs = 0
old_throttle = ship.throttle
window.Add(new(ui.Button,"Start Hover",function()
@SYZYGY-DEV333
SYZYGY-DEV333 / trongle.js
Created October 30, 2019 17:59
very bad ai for 9007199254740992
var x = 0;
var active = true;
var prev = JSON.stringify(GM.grid.cells);
function moved() {
if (prev == JSON.stringify(GM.grid.cells)) {
prev = JSON.stringify(GM.grid.cells);
return false
} else {
@SYZYGY-DEV333
SYZYGY-DEV333 / palindrome.go
Last active October 17, 2019 00:47
create a palindrome from a number by reversing digits and adding
package main
import (
"strconv";
"reflect"
)
func intToSlice(num int) ([]int) {
str := strconv.Itoa(num)
var nums []int
@SYZYGY-DEV333
SYZYGY-DEV333 / lambda-ski.scm
Created April 8, 2019 19:59
Lambda Calculus to SKI
(define (lambda-to-ski f)
(match f
[`(lambda (,a) (lambda (,b) ,c)) (lambda-to-ski `(lambda (,a) ,(lambda-to-ski `(lambda (,b) ,c))))]
[`(lambda (,a) (,exp1 ,exp2)) `((s ,(lambda-to-ski `(lambda (,a) ,exp1))) ,(lambda-to-ski `(lambda (,a) ,exp2)))]
[`(lambda (,a) ,a) 'i]
[`(lambda (,a) ,b) `(k ,(lambda-to-ski b))]
[`(,a ,b) `(,(lambda-to-ski a) ,(lambda-to-ski b))]
[_ f]))
@SYZYGY-DEV333
SYZYGY-DEV333 / lisplisp2lazyk.scm
Created April 7, 2019 22:46
LispLisp to LazyK
(define (replace source target replacement)
(cond ((null? source)'())
((equal? source target) replacement)
(else (let ((next (car source))
(rest (cdr source)))
(cons (if (not (list? next))
next
(replace next target replacement))
(replace rest target replacement))))))
@SYZYGY-DEV333
SYZYGY-DEV333 / md5.go
Created October 11, 2018 00:16
MD5 in GO and SMALLTALK
package main
import (
"fmt"
"math"
"bytes"
"encoding/binary"
)
type testCase struct {
@SYZYGY-DEV333
SYZYGY-DEV333 / infix-prefix.st
Last active October 6, 2018 22:13
Infix to Pre- or Postfix in GNU Smalltalk
Object subclass: Conversion [
isOperator: c [
(c isAlphaNumeric) ifFalse: [ ^true ].
(c isAlphaNumeric) ifTrue: [ ^false ].
]
getPriority: char [
(char = $-) ifTrue: [ ^1 ].
(char = $+) ifTrue: [ ^1 ].
(char = $/) ifTrue: [ ^2 ].
@SYZYGY-DEV333
SYZYGY-DEV333 / nth-root-a.st
Created October 3, 2018 01:23
Nth root of A. `gst nth-root-a.st -a N A`
Number extend [
nthRoot: n [
|x0 m x1|
x0 := (self / n) asFloatD.
m := n - 1.
[true] whileTrue: [
x1 := ((m * x0) + (self/(x0 raisedTo: m))) / n.
((x1 - x0) abs) < ((x0 * 1e-9) abs)
ifTrue: [ ^ x1 ].
x0 := x1.
@SYZYGY-DEV333
SYZYGY-DEV333 / internet.bat
Last active October 10, 2017 12:35
Internet Connection fixer for when you are connected to a bad DHCP server in windows
@echo
set "host=8.8.8.8"
:loop
ping -n 1 "%host%" | findstr /r /c:"[0-9] *ms"
if %errorlevel% == 0 (
ipconfig /all
echo Success!
msg * Success!