Skip to content

Instantly share code, notes, and snippets.

View blewert's full-sized avatar
:fishsticks:
knee deep in marking

Benjamin Williams blewert

:fishsticks:
knee deep in marking
View GitHub Profile
@blewert
blewert / gulpfile.js
Last active January 31, 2026 23:15
A minimal example of using marked with gulp.js without the need for a separate package to do it for you.
/*
This is free and unencumbered software released into the public domain.
Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.
In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
@blewert
blewert / WaveSpawnerDataAuthoring.cs
Created January 28, 2026 12:39
ECS-based wave spawner, data conversion from managed to unmanaged without BlobAssets.
using Unity.Entities;
using UnityEngine;
using WaveSpawner.Entities;
///This namespace contains MonoBehaviour authoring scripts for wave
///spawning data.
///
namespace WaveSpawner
{
#region Units
@blewert
blewert / script.js
Created May 28, 2024 10:08
A small script to automate creating (click student, click save, click close, loop) Blackboard Ultra submissions when in offline mode
let submissions = Array.from(document.querySelectorAll("bb-submission-list-row"));
let submissionsToClick = submissions.filter(x => x.querySelector(".status-header").textContent != "Submitted")
function clickClose()
{
//Click close button
document.querySelector("button.bb-close").click();
console.log("Clicking close");
}
@blewert
blewert / README.md
Last active April 18, 2024 17:05
Unity in-scene rect tool editor

rect tool

Unity in-scene rect tool editor

This is a small proof-of-concept project in Unity 2022 to enable the free translation and modification of various axis-aligned rectangles in-scene. The rectangles are oriented on the xz plane. This was made to help a student out with some initial code for a tools development module. The solution uses a single class, Rectangle, which has four points as members. The RectangleEditor editor script performs in-scene tooling via the Handles class to:

  1. Enable free movement of the rectangles via a handle in the centroid of the rectangle.
  2. Enable free, axis-aligned resizing of the rectangles via the four small circles shown in the image above.

This code is licensed under the Unlicense; feel free to copy, modify or whatever.

This file has been truncated, but you can view the full file.
[session]
car = Porsche 911 GT3 RS
class = Road B
track = Bannochbrae
track_variant = Road Circuit
[data]
0.065979 70.2297 -39.7066 5.84384 0.00150648 -1.53196 -0.000349648 0.0001023 0.0208138 -0.707481 0.00123274 -0.199091 -5.38907 -0.028807 3.83475e-05 0.000605562 1 0 1 0.741386 8775.24 0.729717 -1.07374e+08 0.990368 0.990854 0.998327 0.997332 344.927 344.915 344.977 344.988 -2.03882 -2.04214 -2.01899 -2.01899 -0.452479 -0.405347 0.623045 35.1224 1167.48 0
0.132996 70.2922 -39.7051 5.84139 0.00356337 -1.53196 -0.000412736 0.000128803 0.00799681 -1.12016 0.000665879 -0.123741 -6.802 -0.0319154 -0.00016346 0.0010617 1 0 1 0.688014 8820.48 1.14536 -1.07374e+08 0.987139 0.989738 0.957024 0.955022 344.929 344.913 344.937 344.948 -3.22798 -3.22743 -3.28368 -3.28368 -0.452479 -0.405347 0.623045 35.2128 1167.08 0
const config = require('./cfg/streams.json');
const { spawn } = require('child_process');
var streamProcs = [];
for(let stream of config.streams)
{
let streamProc = spawn("node", ["stream.js", stream.port, stream.url ]);
console.log(`> Started stream ${stream.key} on port ${stream.port}: ${stream.url}`);
t_test_pneg = 0
t_test_pneu = 0
t_test_nneu = 0
ans =
0.4820 0.5271 0.5012
t_test_polarity_pneg = 0.9589
t_test_polarity_pneu = 0
t_test_polarity_nneu = 0
@blewert
blewert / SimpleModularBuildingGenerator.cs
Created January 14, 2021 12:39
A simple modular building generator for Unity.
/**
* @brief A simple modular building generator for Unity.
* @author Benjamin Williams
*/
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class SimpleModularBuildingGenerator : MonoBehaviour
from math import sqrt;
import random
import string
s = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
keyset = ''.join(random.sample(s,len(s)));
cleartext = "wepogkwepokgwep jgwokegpo wkepgo kwepogkwpoekgpowekgpowekgpowekgpokweg wekgpowegpokweg".upper();
cur_hp = 90;
cur_ar = 10;
print("hp: " + str(cur_hp));
print("ar: " + str(cur_ar));
damage = 333.7;
print("\n-" + str(damage));
# armour