Skip to content

Instantly share code, notes, and snippets.

View Rlesjak's full-sized avatar

Robert Lesjak Rlesjak

View GitHub Profile
@Rlesjak
Rlesjak / maze.c
Created March 26, 2023 17:17
Simple maze solver in C
#include <stdio.h>
#include <assert.h>
#include <stdlib.h>
#include <stdbool.h>
typedef struct {
int x;
int y;
} Point;
@Rlesjak
Rlesjak / cachedFetch.js
Created July 17, 2022 14:53
Simple cached fetch in Vue3 with composable functions.
import { computed, reactive, ref } from "vue";
export const useFetch = (url, config = {}) => {
const data = ref(null);
const error = ref(null);
const loading = ref(null);
const _fetch = async () => {
loading.value = true;
@Rlesjak
Rlesjak / fifo.cpp
Created March 27, 2022 15:43
Fifo Buffer - c++
#include <fifo.h>
// Buffer head is always kept on the first available(empty) element of the buffer
// it is not kept on the last written element!
void fifo_push(fifo_controller_t *controller, float value)
{
// Write to current head
controller->arr[controller->head] = value;
<!DOCTYPE html>
<html>
<head>
<title>Demo Application</title>
<style>
#jscad{
width: 15cm;
height: 15cm;
margin: 0;
outline: 1px solid black;