Skip to content

Instantly share code, notes, and snippets.

@zvodd
zvodd / howtobasicrust.rs
Created May 9, 2022 16:28
Baby's first rust code. A basic guessing game that was primarily a product of trail and error, as tutorials just aren't as much fun as breaking things.
use rand::Rng;
use std::io;
static HINT_HIGHER: &str = "higher";
static HINT_LOWER: &str = "lower";
fn main() {
println!("Guess the integer between 0 and 9.");
let target: u8 = rand::thread_rng().gen_range(1..10);
@zvodd
zvodd / index.html
Created April 19, 2022 09:27
Client Side JS - Image Upload to Canvas
<!DOCTYPE html>
<html><head>
<style>
.finfo-list{
list-style: none;
display: flex;
flex-wrap: wrap;
align-items: flex-start;
flex-direction: row;
max-height: 80vh;
@zvodd
zvodd / HTML_Canvas_Lines.htm
Created March 24, 2021 20:07
drawing stuff in canvas
<html>
<head>
<style>
.container{ display:inline-flex;}
#backButton button{width:100%; height:100%}
#nextButton{ }
#nextButton button{width:100%; height:100%}
</style>
</head>
<body>
@zvodd
zvodd / Go CGO on window.md
Last active December 23, 2020 04:48
Building Go CGO on windows

Install Msys2 Open the MSYS terminal run the updates and then enter these commands.

pacman -Syu

Close and Re-Open Msys2 Terminal

pacman -Su

pacman -Sy base-devel mingw-w64-x86_64-gcc

@zvodd
zvodd / hardmode.py
Last active September 17, 2020 19:21
python asssingment completion example using an obscene amount of generator comprehensions.
# opening the csv file
def read_file(csvfile):
file = open(csvfile, 'r')
file.readline()
line = file.readline()
while line:
line = line.strip()
values = line.split(",")
new_values = []
for i, attr in enumerate(values):
@zvodd
zvodd / ConvertItermJSON.py
Last active August 5, 2020 04:45
Takes Item2.json convets to windows colortool (ini) format
import sys, json
MAIN_COLORS = ["BLACK","BLUE","GREEN","CYAN","RED","MAGENTA","YELLOW","WHITE"]
class PrintBuf(object):
def __init__(self):
self.pb = ""
def print(self, *args):
msg = ' '.join(args)

Vagrant Setup on Windows 10: Hyper-V instead of VirtualBox

How to setup Vagrant on Windows 10 using Hyper-V instead of VirtualBox, for STAT1400.

Hyper-V is NOT supported on Windows 10 - Home Edition, you will need Pro Edition or similar.

Enabling AMD-V or Intel VT-X

This depends on your proccessor type AMD or Intel

@zvodd
zvodd / howto_PostCSS_SASS_in_gatsby.md
Last active July 4, 2020 03:31
Using Sass and PostCSS together in Gatsby

install packages

    npm add gatsby-plugin-sass node-sass postcss-import postcss-preset-env

gatsby-config.js

module.exports = {
  plugins: [
    {
@zvodd
zvodd / pyImplanter.py
Created March 24, 2020 03:35
What is this, a binary patcher for ants? Don't @ me!
import argparse
from pprint import pprint
def main():
parser = argparse.ArgumentParser()
parser.add_argument('src_offsets_sizes',
type=argparse.FileType('r'))
parser.add_argument('source_file',
type=argparse.FileType('rb'))