Skip to content

Instantly share code, notes, and snippets.

View lunandd's full-sized avatar
🕳️

Pavlos Efstathiou lunandd

🕳️
View GitHub Profile
const GROWTH_RATE: f64 = 3.9666;
const GENERATIONS: usize = 2000;
const STARTING_POPULATION: f64 = 0.975;
fn main() {
let mut data: Vec<(usize, f64)> = Vec::with_capacity(GENERATIONS);
println!("Initial Population: {STARTING_POPULATION}");
data.push((0, STARTING_POPULATION as f64));
for i in 1..=GENERATIONS {
const device_pins = [
AnalogPin.P0,
AnalogPin.P1,
AnalogPin.P2,
AnalogPin.P3,
AnalogPin.P4,
AnalogPin.P5,
AnalogPin.P6,
AnalogPin.P7,
AnalogPin.P8,
module FireworkPrelude where
import Data.Int
import Data.Int (Int64)
import Data.String
type I32 = Int
type I64 = Int64
data FireworkEnv = FireworkEnv
@lunandd
lunandd / inkwell_error.txt
Last active October 24, 2021 14:08
Command to write cargo's output to a file: cargo run 2>&1 | tee errors.txt
Compiling llvm-test v0.1.0 (C:\Users\jimos\llvm-test)
warning: unused imports: `InitializationConfig`, `Target`
--> src\main.rs:5:24
|
5 | use inkwell::targets::{InitializationConfig, Target};
| ^^^^^^^^^^^^^^^^^^^^ ^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
error: linking with `link.exe` failed: exit code: 1120
const E2 = 82.41;
const A2 = 110.00;
const D3 = 146.83;
const G3 = 196.00;
const B3 = 246.94;
const E4 = 329.63;
input.onButtonPressed(Button.A, () => {
midi.playTone(E2, music.beat(BeatFraction.Whole))
})
pavlos in ~ λ apt list | grep -i zsh
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
fizsh/focal 1.0.9-1 all
zsh-antigen/focal 2.2.3-2 all
zsh-autosuggestions/focal 0.6.4-1 all
zsh-common/focal,now 5.8-3ubuntu1 all [installed,automatic]
zsh-dev/focal 5.8-3ubuntu1 amd64
zsh-doc/focal 5.8-3ubuntu1 all
DISM /Online /Cleanup-Image /RestoreHealth
sfc /scannow
DISM /Online /Cleanup-Image /ScanHealth
DISM /Online /Cleanup-Image /CheckHealth
DISM /Online /Cleanup-Image /RestoreHealth
sfc /scannow
use rand;
use rand::distributions::{Distribution, Uniform};
fn rand_string(amount: u32) -> String {
let mut rng = rand::thread_rng();
let random = Uniform::from(30..=800);
(1..=amount).map(|_| char::from_u32(random.sample(&mut rng)).unwrap()).collect::<String>()
}
fn main() {
for _ in 1..=100 {
fn main() {
println!("{}", rgb_to_hex(171, 205, 239));
}
fn rgb_to_hex(r: u8, g: u8, b: u8) -> String {
let mut hex: String = "".into();
let rgb_colors: [u8; 3] = [r, g, b];
for color in rgb_colors.iter() {
@lunandd
lunandd / style.css
Last active August 10, 2021 14:26
Some CSS
@import url(https://fonts.googleapis.com/css2?family=Fira+Code:wght@600);
body {
background: url(https://csshint.com/wp-content/uploads/2020/01/CSS-Animated-Backgrounds-2.gif);
font-family: "Fira Code", monospace !important; /* Fira Code didn't work because it had single quotes 'Fira Code' and my Browser made it this "'Fira Code'" */
color: #f9f9f9;
cursor: auto;
cursor: url(https://i.ibb.co/CMswZdQ/cursor.png), auto; /*https://i.ibb.co/30FCBDJ/3058-256x256x32.png*/
zoom: 1.04;
-moz-transform: scale(1.04);