Skip to content

Instantly share code, notes, and snippets.

View zyrouge's full-sized avatar

Zyrouge zyrouge

View GitHub Profile
@zyrouge
zyrouge / entity.ts
Last active December 5, 2022 10:00
Filesystem from just paths
import { VFSPath } from "./path"
export abstract class VFSEntity {
basename: string
parent?: VFSEntity
constructor(basename: string, parent?: VFSEntity) {
this.basename = basename
this.parent = parent
}
@zyrouge
zyrouge / sorts.md
Last active June 29, 2022 03:53
Sorts make you go :stonks:

Bubble Sort

Swap in pairs until sorted.

Example:

  • 3, 4, 2, 1 (Initial)
  • 3, 4, 2, 1
  • 3, 2, 4, 1
  • 3, 2, 1, 4
  • 2, 3, 1, 4
@zyrouge
zyrouge / c-custom-array.c
Last active March 26, 2022 14:15
C - Array using pointers
#include <stdio.h>
#include <stdlib.h>
struct Array {
int* values;
int size;
};
struct Array performInitialization(struct Array array) {
int i;
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Progress Bar</title>
<script src="https://unpkg.com/vue@next"></script>
</head>
@zyrouge
zyrouge / meta-tags.md
Created April 17, 2021 09:55 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">
@zyrouge
zyrouge / Simple dot notation parser.js
Last active November 5, 2020 05:22
Parses dot notation (also array indexes and string indexes). Runkit URL: https://runkit.com/zyrouge/5fa2c995ad3709001b2054cb
const getPath = (path) => {
path = path.replace(/(\"|\')?\]/g, ".");
path = path.split("["); // fbrac
path = path.map(p => p.startsWith("\"") ? p.replace("\"", "") : (p.startsWith("'") ? p.replace("'", "") : p));
path = path.map(p => p.endsWith(".") ? p.slice(0, p.length - 1) : p);
path = path.join(".").split(".");
return path;
}
const dotnot = "xd.lmao[0]hello.oof['oofies']";