Skip to content

Instantly share code, notes, and snippets.

@Luxvao
Luxvao / server.sh
Last active October 7, 2025 16:41
A server setup script
#! /usr/bin/env bash
# Setup folders
mkdir ~/server/caddy -p
mkdir ~/server/filestash
mkdir ~/server/sftp_storage
# Create files
# First the Caddyfile
cat <<EOF > ~/server/caddy/Caddyfile
use bio::alignment::pairwise::Aligner;
struct MotifChecker {
motifs: Vec<(i32, String)>,
aligner: Aligner<fn(u8, u8) -> i32>,
threshold: f64,
}
impl MotifChecker {
fn new(motifs: Vec<(i32, String)>, threshold: f64) -> Self {
@Luxvao
Luxvao / config.toml
Created September 24, 2024 19:10
Helix config
theme = "rose_pine_moon"
[editor.cursor-shape]
insert = "bar"
normal = "block"
select = "underline"
[keys.normal]
"space" = { w = { c = ":quit" } }
@Luxvao
Luxvao / hyprland.conf
Created September 24, 2024 19:09
Hyprland config
################
### MONITORS ###
################
# See https://wiki.hyprland.org/Configuring/Monitors/
# Setup monitors when installing
###################
### MY PROGRAMS ###
###################
@Luxvao
Luxvao / alacritty.toml
Created September 24, 2024 19:07
Configuration for alacritty. I need to share it quickly
[colors.bright]
black = "#5C6370"
blue = "#61AFEF"
cyan = "#54AFBC"
green = "#98C379"
magenta = "#C678DD"
red = "#E86671"
white = "0xf7f7f7"
yellow = "#E5C07B"
use core::{alloc::GlobalAlloc, ptr::null_mut};
pub const KERNEL_HEAP_SIZE: usize = 1048576;
pub const KERNEL_HEAP_NODE_STRUCTURE_SIZE: usize = 1000;
const KERNEL_HEAP: [u8; KERNEL_HEAP_SIZE] = [0; KERNEL_HEAP_SIZE];
static KERNEL_NODES: [HeapNode; KERNEL_HEAP_NODE_STRUCTURE_SIZE] =
[HeapNode::new(); KERNEL_HEAP_NODE_STRUCTURE_SIZE];
#[global_allocator]
@Luxvao
Luxvao / alacritty.yml
Created October 21, 2023 17:51
Alacritty dotfiles
# Catppuccino theme scheme for Alacritty
window:
padding:
x: 4
y: 2
class:
instance: Alacritty
general: Alacritty
dimensions:
@Luxvao
Luxvao / .hyper.js
Last active May 12, 2023 19:26
My hyper terminal config file
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@Luxvao
Luxvao / 3_line_trivia.rs
Last active May 3, 2023 16:21
A trivia game in 3 lines of Rust code (including the main function)
fn main() {
if let mut qna = ((vec![(String::from("Is this compact?"), String::from("yep")), (String::from("Is it tho?"), String::from("yes it is"))], String::new(), 0, 0), |qna: &mut (Vec<(String, String)>, String, i32, i32)| ({qna.3 = qna.0.len() as i32}, {qna.2 = qna.0.iter_mut().filter(|i| ({println!("{}", i.0)}, {std::io::stdin().read_line(&mut qna.1).unwrap()}, {qna.1 = qna.1.contains(&i.1).to_string()}, {qna.1.parse().unwrap()}, {println!("{}", qna.1.replace("true", "Correct!").replace("false", "Incorrect!"))}).3).collect::<Vec<&mut (String, String)>>().len() as i32}, println!("Points: {}/{}", qna.2, qna.3))) { qna.1(&mut qna.0); };
}