Skip to content

Instantly share code, notes, and snippets.

View ORESoftware's full-sized avatar

Alexander Mills ORESoftware

View GitHub Profile
ORESoftware / main.gleam
Created February 25, 2024 08:18
Main gleamlang file
import gleam_cowboy
import gleam/http.{Request, Response}
import gleam/http/response.{ok}
pub fn main() {
gleam_cowboy.start(fn(_req: Request) {
ok("Hello, Gleam!")
}, on_port: 3000)
ORESoftware /
Last active January 17, 2024 20:36
goroutine reuse for logging purposes

Code looks fine to me. There might be a hidden race condition. The p.Count++ and p.Count-- are atomic ops. For every ++ it's corresponding -- should be called TBD.

package pool

import (

we can use this domain middleware

const Domain = require('domain');

app.use((req,res,next) => {
ORESoftware / fixed.js
Last active December 27, 2022 09:53
here is fix for code
const getBBBMeetingInfo = async (meetingID) => {
const getMeetingInfo = api.monitoring.getMeetingInfo(meetingID);
const result = await bbb.http(getMeetingInfo);
result.meetingID = meetingID;
if(result.returncode == 'FAILED'){

This is some bad code, but illustrates the difficulty, futility, and pointlessness of implementing map/filter with Iterables.

Note that these are lazy (not eager). Nothing runs until the for..of is called on an instance, etc.

class IterableWMapFilter<T> {

  vals : T[]= [];
ORESoftware / server.js
Last active December 23, 2022 22:23
basic node server
const http = require('http');
const server = http.createServer((request, response) => {
<html> hello world this is julian, here is an image: <br>
<img src=""></img>
ORESoftware /
Created December 22, 2022 01:59
iterable int in javascript / typescript

this code does what you'd expect and useful for avoiding unnecessary arrays (although a standard for-loop is usually fine...)

export class IterableInt {

  point = 0;
  start: number = 0;
  end: number = 0;
alex % test-sorted-numbers.js

ORESoftware /
Last active October 20, 2022 15:34
algorithm - quickly determine if two numeric JS arrays are linearly independent

This is an algorithm (function) that accepts two numeric JS/TS arrays and returns a boolean value representing whether the two arrays are linearly independent. This would be for a linear library or linear optimization - in my case - checking constraints for redundancy or contradictions.


1. Same size arrays
2. If size is less than 2, undefined results
3. None of the arrays are the zero-vector [0,0,0,0,0,...,0]
4. For any given pair, if the numerator or denominator is zero and the other non-zero, 
ORESoftware /
Created September 11, 2022 18:33
code for class
Assignment #1. Matrix Generation and Solving Simultaneous Equations; Due Tuesday, September 13

Part 1.  Write a random matrix generator for an n  m matrix A = (aij) that has a prespecified density.
    Input should include n, m, a general lower bound (L) for each element, an upper bound (U) for each
    element (that is, L  aij  U), and density factor  where 0 <   1.  Note that if  = 0.4, this means that
there is a 0.4 probability that any element aij will not be zero or that on average, 4 out of 10 elements will