Skip to content

Instantly share code, notes, and snippets.

View selfup's full-sized avatar
💻
doing the most

Regis Boudinot selfup

💻
doing the most
View GitHub Profile
@selfup
selfup / fizz_buzz.rs
Last active January 16, 2023 16:12
Parallel FizzBuzz Vec Builder in Rust
use rayon::prelude::*;
const VEC_SIZE: usize = 1_000_000_001;
const CHUNK_SIZE: usize = 128;
enum FizzBuzz {
FIFTEEN,
THREE,
FIVE,
VALUE(u32),
layout title published
post
Decrease Memory Using Enums in Rust
true

Decrease Memory Using Enums in Rust

I am slowly building a sort of atom/universe generator/visualizer in Rust with friends. The project is called Oxidizy.

sudo ls /var/crash
sudo rm /var/crash/*
sudo ls /var/crash

Keybase proof

I hereby claim:

  • I am selfup on github.
  • I am selfup (https://keybase.io/selfup) on keybase.
  • I have a public key whose fingerprint is F6BD CA79 8ED7 CF49 B9FF CAA8 2977 288B EE59 5B60

To claim this, I am signing this object:

defmodule Encrypto do
@encrypto_secret_key System.get_env("ENCRYPTO_SECRET_KEY")
@encrypto_aad_context System.get_env("ENCRYPTO_AAD_CONTEXT")
def encrypt(msg) do
decoded_key = Base.decode16!(@encrypto_secret_key)
iv = :crypto.strong_rand_bytes(32)
{ct, tag} = :crypto.block_encrypt(:aes_gcm, decoded_key, iv, {@encrypto_aad_context, msg})
@selfup
selfup / computer_burn_in.go
Last active June 14, 2020 00:40
Burn in new CPU/RAM (otherwise completely useless) | Example: go run main.go -s 128 -w 4
package main
import (
"flag"
"fmt"
"math/rand"
"os"
"sync"
"time"
)
##########################
# THIS ONLY WORKS ON LINUX
##########################
# $ amidi -l
# Dir Device Name
# IO hw:1,0,0 Elektron Digitone MIDI 1
set -e
package main
import (
"flag"
"fmt"
"io/ioutil"
"os"
"runtime"
"strings"
"sync"
package main
import (
"flag"
"fmt"
"io/ioutil"
"os"
"runtime"
"strings"
"sync"
#!/usr/bin/env bash
######
# This script assumes you are on Ubuntu 18.04 LTS
# Everything will be setup/installed in your home dir
######
set -e
cd $HOME