Skip to content

Instantly share code, notes, and snippets.

View mkontsek's full-sized avatar

MvK mkontsek

View GitHub Profile
@mkontsek
mkontsek / html-on-black-hole-accretion-disk.html
Created April 15, 2026 09:31
HTML on a Black hole's Accretion Disk
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>HTML on Black Hole Accretion Disc</title>
<style>
* { margin: 0; padding: 0; box-sizing: border-box; }
body { background: #000; overflow: hidden; }
canvas#gl { display: block; width: 100vw; height: 100vh; cursor: grab; }
@mkontsek
mkontsek / DynamicSsrImport.tsx
Created November 18, 2020 14:06
Dynamic ssr import component when you're using server side rendering, but you have a component that has to wait 😊
import React from "react";
type Props = {
exportedName?: string;
fetchFn(): Promise<any>;
[x: string]: any; // rest props
};
export const DynamicSsrImport = ({
exportedName = "default",
@mkontsek
mkontsek / vCard decode and latinize
Created April 23, 2020 13:41
When you want to export / import vcf and quoted printable is unsupported in phone
const utf8 = require('utf8');
const quotedPrintable = require('quoted-printable');
const fs = require('fs');
const readline = require('readline');
const DELIMITER = ';CHARSET=UTF-8;ENCODING=QUOTED-PRINTABLE:';
const readStream = fs.createReadStream('./contacts.vcf');
const writeStream = fs.createWriteStream('./contactsDecoded.vcf', {
encoding: 'utf8',
import React from 'react';
import { fetchFn } from './myAsyncService'
export function cancellableEffect(asyncFunction, afterFunction) {
let isCancelled = false;
const runAsyncFunction = async () => {
const data = await asyncFunction();
if (isCancelled) {