Skip to content

Instantly share code, notes, and snippets.

View radum's full-sized avatar
🚀
I can see what you see not

Radu Micu radum

🚀
I can see what you see not
View GitHub Profile
@radum
radum / dom3d.js
Created April 6, 2024 14:35 — forked from OrionReed/dom3d.js
3D DOM viewer, copy-paste this into your console to visualise the DOM topographically.
// 3D Dom viewer, copy-paste this into your console to visualise the DOM as a stack of solid blocks.
// You can also minify and save it as a bookmarklet (https://www.freecodecamp.org/news/what-are-bookmarklets/)
(() => {
const SHOW_SIDES = false; // color sides of DOM nodes?
const COLOR_SURFACE = true; // color tops of DOM nodes?
const COLOR_RANDOM = false; // randomise color?
const COLOR_HUE = 190; // hue in HSL (https://hslpicker.com)
const MAX_ROTATION = 180; // set to 360 to rotate all the way round
const THICKNESS = 20; // thickness of layers
const DISTANCE = 10000; // ¯\\_(ツ)_/¯
@radum
radum / esm-package.md
Created June 18, 2023 20:07 — forked from sindresorhus/esm-package.md
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@radum
radum / video4web.sh
Created May 13, 2021 08:24 — forked from mfd/ffmpeg.md
video4web
#!/bin/bash
# Generates a cover image along with mute web-ready WebM and MP4 files for each master video in a folder.
# See: https://gist.github.com/jaydenseric/220c785d6289bcfd7366.
# Parameter 1: Input video format (e.g. "mov").
# Parameter 2: Output width in pixels (e.g. "1280").
# Example use: "./video4web.sh mov 1280".
mkdir web
/**
* A bookmarklet for viewing the largest contentful paint in a page.
* Will show each LCP after the bookmarklet is clicked.
*
* To install:
* 1. Copy the code starting from the line beginning `javascript:`
* 2. Add a new bookmark in Chrome, and paste the code in as the URL.
**/
javascript:(function(){
try {
@radum
radum / perf-diagnostics.css
Created January 22, 2021 21:28 — forked from tkadlec/perf-diagnostics.css
CSS used to highlight potential performance issues
:root {
--violation-color: red; /* used for clear issues */
--warning-color: orange; /* used for potential issues we should look into */
}
/* IMAGES */
/*
* Lazy-Loaded Images Check
* ====

What Hiring Should Look Like

This is definitely not the first time I've written about this topic, but I haven't written formally about it in quite awhile. So I want to revisit why I think technical-position interviewing is so poorly designed, and lay out what I think would be a better process.

I'm just one guy, with a bunch of strong opinions and a bunch of flaws. So take these suggestions with a grain of salt. I'm sure there's a lot of talented, passionate folks with other thoughts, and some are probably a lot more interesting and useful than my own.

But at the same time, I hope you'll set aside the assumptions and status quo of how interviewing is always done. Just because you were hired a certain way, and even if you liked it, doesn't mean that it's a good interview process to repeat.

If you're happy with the way technical interviewing currently works at your company, fine. Just stop, don't read any further. I'm not going to spend any effort trying to convince you otherwise.

@radum
radum / ClassA.js
Created October 28, 2019 14:54 — forked from ilfroloff/ClassA.js
JavaScript Singleton using class
'use strict';
import Singleton from 'Singleton';
class ClassA extends Singleton {
constructor() {
super();
}
singletonMethod1() {
// ...
@radum
radum / README
Created January 23, 2019 11:21 — forked from joelambert/README
Drop in replacements for setTimeout()/setInterval() that makes use of requestAnimationFrame() where possible for better performance
Drop in replace functions for setTimeout() & setInterval() that
make use of requestAnimationFrame() for performance where available
http://www.joelambert.co.uk
Copyright 2011, Joe Lambert.
Free to use under the MIT license.
http://www.opensource.org/licenses/mit-license.php
@radum
radum / redux-mini.js
Created November 13, 2018 13:40 — forked from jakoblind/redux-mini.js
A mini redux implementation
/*
You need node 6.9 or later.
Run with:
node redux-mini.js --harmony
Want a more in depth explanation of how things works? Read the blog post I have written about it here:
http://blog.jakoblind.no/2017/03/13/learn-redux-by-coding-a-mini-redux/
*/
/*
@radum
radum / getOverlap.js
Created October 18, 2018 19:08 — forked from pankajpatel/getOverlap.js
Function to get the overlap between two elements
/**
* isOverlapping() returns the overlapping status between two elements
* based on the passed in Element objects
*
* @param {Element, Element} Element object of DOM
* @return {Boolean|null} overlap status or null if native objet not received
*/
function isOverlapping(e1, e2){
if( e1.length && e1.length > 1 ){
e1 = e1[0];