GithubHelp home page GithubHelp logo

nv0skar / seekhub Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 1.0 198 KB

A web potfolio for menus πŸ§ͺ

License: GNU General Public License v3.0

HTML 38.53% TypeScript 61.47%
deno js portfolio typescript website

seekhub's Introduction

γ“γ‚“γ«γ‘γ―δΈ–η•ŒοΌ

人物描写 πŸ™

#![allow(non_snake_case)]
const FRAME_CHARACTER: &str = "β—ΌοΈŽ";

struct Myself {
    name: String,
    target: String,
    remainingFuel: String,
}

mod beautify {
    use crate::FRAME_CHARACTER;
    pub enum Frame {
        X(usize),
        Y,
    }
    pub fn print_fancy_border(position: Frame, newLine: bool) {
        match position {
            Frame::X(max_repeat) => { print!(" \x1b[93m{}{}\x1b[0m", FRAME_CHARACTER.repeat(max_repeat), { if newLine { "\n" } else { "" } }); }
            Frame::Y => { print!("\x1b[93m{}{}\x1b[0m", FRAME_CHARACTER, { if newLine { "\n" } else { "" } }); }
        }
    }
    pub fn print_beautifully(string_list: &[String]) {
        let longest_line = check_longest(&string_list);
        print_fancy_border(Frame::X(longest_line), true);
        for line in string_list {
            print_fancy_border(Frame::Y, false);
            print!("\x1b[97m{}\x1b[0m{}", line, {
                if line.chars().count() != longest_line {
                    " ".repeat(longest_line - line.chars().count())
                } else {
                    String::default()
                }
            });
            print_fancy_border(Frame::Y, true);
        }
        print_fancy_border(Frame::X(longest_line), true);
    }
    pub fn check_longest(string_list: &[String]) -> usize {
        let mut longest: usize = 0;
        for line in string_list {
            if longest < line.chars().count() {
                longest = line.chars().count();
            }
        }
        longest + 1
    }
}

fn main() {
    // Define my name
    let name: String = String::from("Oscar");
    // Define my target
    let target: String = String::from("Goin' to stars!");
    // Define my remaining fuel
    let remainingFuel: String = String::from("∞");
    // Define myself
    let myself: &Myself = &Myself { name, target, remainingFuel };
    // Show on screen
    {
        let to_display = [
            { String::from(format!(" Hey! My name is {}.", { &myself.name })) },
            { String::from(format!(" {}", &myself.target)) },
            { String::from(format!(" Remaining fuel: {}", { &myself.remainingFuel })) },
        ];
        beautify::print_beautifully(&to_display);
    }
}

ε…₯εŠ›/ε‡ΊεŠ› πŸͺ¨

  • Crabs! πŸ¦€
  • Pythonic citizen 🐍
  • Swift-architect πŸ¦‰
  • Typescript-poet πŸ“œ
  • C-ish dialects in general πŸ—Ώ

ζœͺζ₯ πŸ”­

  • Zig ⚑️
  • OCaml ☯️
  • Kiban 🍱

seekhub's People

Contributors

nv0skar avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

whiteolivetree

seekhub's Issues

Change the setup API route

I think that could be less confusing if there is a separate route to submit setup data, let's say /setup. Right now the way it works is by sending a POST request to / while the setup isn't completed, if the setup is completed it will return an error page.

Cache the static content

To reduce the disk usage, I think that could be a good idea to cache all the static pages to memory at the program's initialization. Another possibility is to render the page contents at initialization, so the whole page doesn't have to render each time a request is made.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.