Skip to content

Instantly share code, notes, and snippets.

View rhighs's full-sized avatar

Roberto Montalti rhighs

View GitHub Profile
@rhighs
rhighs / prim_mst.rs
Last active November 14, 2021 10:27
A rust implementation of the Prim's mst algorithm.
use random::Source;
mod structures {
#[derive(Eq, PartialEq, Clone, Copy)]
pub struct Branch {
pub x: u32,
pub y: u32,
pub w: u32
}
@rhighs
rhighs / sh1ttyg4me.js
Last active September 23, 2021 07:57
A memory game on your terminal.
const fs = require("fs");
const memoryGame = () => {
class util {
static readNum() {
let buffer = Buffer.alloc(4);
buffer.fill(0);
fs.readSync(0 /*stdin*/, buffer, 0, 4);
return buffer[0] % 48; //( ͡° ͜ʖ ͡°)
}
@rhighs
rhighs / simple_curl.cc
Last active June 7, 2021 16:37
a simple curl req for later
#include <iostream>
#include <string>
#include <curl/curl.h>
int main(void)
{
CURL *curl;
curl_global_init(CURL_GLOBAL_ALL);
curl = curl_easy_init();
std::string url = "http://httpbin.org/post";