Skip to content

Instantly share code, notes, and snippets.

View DeadlySurgeon's full-sized avatar
💉

The Surgeon DeadlySurgeon

💉
View GitHub Profile
@DeadlySurgeon
DeadlySurgeon / Square.go
Created February 3, 2024 05:07
Just a colorful square.
package main
import (
"context"
"fmt"
"os"
"os/signal"
"strings"
"time"
@DeadlySurgeon
DeadlySurgeon / Concurrency.md
Last active November 6, 2023 17:25
Go Concurrency Outline

Concurrency

This talk will go over concurrency with Go, and hopefully scratch the surface of how to write thread safe code as well as efficient worker delegation. We will be using the bult in sync package.

Goroutines

If you've worked with concurrency in other languages, you might be familiar with threading. In Go, we do not manage threads like we would in C or in Java.

@DeadlySurgeon
DeadlySurgeon / main.go
Last active July 24, 2023 02:58
Golang Terminal Percent Bar
package main
import (
"fmt"
"math"
"strings"
"time"
)
var (
@DeadlySurgeon
DeadlySurgeon / dice.go
Last active April 28, 2022 03:15
SVG Dice Generator for Fusion Project
package main
import (
"fmt"
"math"
"reflect"
"strings"
)
// COLORBLACK ...
@DeadlySurgeon
DeadlySurgeon / README.md
Last active March 9, 2022 19:51
POC language syntax

C

Verbal/VerbalScript (.vrbl)

This example bit of syntax can only be described as annoying. I've taken various aspects of different languages and picked out things I hate, and shoved them in. It is unlikely that I'll go far with this language, however I think that if I plan on learning LLVM and need a toy to hook up to it, this will be the syntax for that.

@DeadlySurgeon
DeadlySurgeon / README.md
Last active June 15, 2022 17:26
Reducer

Reducer

POC for effictively reducing a large data footprint.

A good canidate has been found for implementing our reducer function, however more tests should be done to push optimization, not that it is needed. Overall, with harsh benchmarking we expect to see 500~1000 ns/op (I know quite the range) depending on configuration and stack size.

More tests need to be performed though so we can determine the memory

{
"Profiles": [
{
"Link Color" : {
"Red Component" : 0.2919752080924809,
"Color Space" : "sRGB",
"Blue Component" : 0.958709716796875,
"Alpha Component" : 1,
"Green Component" : 0.61811793602673359
},
@DeadlySurgeon
DeadlySurgeon / .env
Last active December 5, 2023 15:51
Settings Example
DATABASE_TABLE=example
DATABASE_DSN=example:password@example.com/example
DATABASE_DRIVER=mysql
PING_LOCATIONS=one,two,three

Strbuf

A small lib to help process and keep a small history of the past STDOUT/STDERR to show off, as well as a line parser to help ease the work needed to get functions called if lines appear in STDOUT/STDERR.

License

Copyright 2022 The Deadly Surgeon

Licensed under the Apache License, Version 2.0 (the "License"); you may not use these files except in compliance with the License. You may obtain a copy of the License at

/*
* robotNav.js
*
* The green key is located in a slightly more
* complicated room. You'll need to get the robot
* past these obstacles.
*/
function startLevel(map) {
// Hint: you can press R or 5 to "rest" and not move the