Skip to content

Instantly share code, notes, and snippets.

View JonathanGetahun's full-sized avatar
🦇

Jonathan Getahun JonathanGetahun

🦇
View GitHub Profile
@JonathanGetahun
JonathanGetahun / mode_strip
Created August 9, 2022 16:48
Finding mode_strip
const mode_strip = (strips) => {
if (strips.length === 0) return [];
let shortestStrip = Infinity;
let total = [];
strips.forEach((strip) => {
if (strip.length < shortestStrip) shortestStrip = strip.length;
});
for (let i = 0; i < shortestStrip; ++i) {
@JonathanGetahun
JonathanGetahun / server.js
Last active February 21, 2021 21:30
Recurse Database Server
const http = require('http');
const hostname = '127.0.0.1';
const fs = require('fs');
const port = 4000;
const readline = require('readline');
const server = http.createServer((req,res) => {
const { url }=req;
current_url = new URL(`http://${hostname}:${port}${url}`);
@JonathanGetahun
JonathanGetahun / index.html
Created May 26, 2020 15:44
Markdown Previews
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<link href="https://fonts.googleapis.com/css2?family=Indie+Flower&display=swap" rel="stylesheet">
<!-- add the awesome font here i guess you can use i or span elements to include it within react code -->
<body>
<h1 id="top" class="text-center"> Markdown Previewer </h1>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="https://fonts.googleapis.com/css2?family=Dosis&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Bad+Script&display=swap" rel="stylesheet">
<body>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="https://fonts.googleapis.com/css2?family=Dosis&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Bad+Script&display=swap" rel="stylesheet">
<body>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link href="https://fonts.googleapis.com/css2?family=Dosis&display=swap" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Bad+Script&display=swap" rel="stylesheet">
<body>