Skip to content

Instantly share code, notes, and snippets.


Erko Bridee erkobridee

View GitHub Profile
steven-tey / title-from-url.ts
Last active Oct 7, 2022
Get Title from URL
View title-from-url.ts
// Note: this gist is a part of this OSS project that I'm currently working on:
export default async function getTitleFromUrl (url: string) {
const controller = new AbortController();
const timeoutId = setTimeout(() => controller.abort(), 2000); // timeout if it takes longer than 2 seconds
const title = await fetch(url, { signal: controller.signal })
.then((res) => {
return res.text();
erkobridee /
Last active Jul 7, 2022
json store in multiple files - key / value pattern
View base64.js
const LOOKUP =
export function encodeBase64(buffer) {
const view = new Uint8Array(buffer);
let out = [];
for (let i = 0; i < view.length; i += 3) {
const [b1, b2 = 0x10000, b3 = 0x10000] = view.subarray(i, i + 3);
b1 >> 2,
sibelius /
Last active Nov 23, 2022
async mentoring rules

Async Mentorship

Most mentees belive that they need sync mentorship to be able to explain their problems. However, I've found that doing an async mentorship using text to provide better results. Mentorship is a long term process, you can't "fix" or "improve" someone in a session, it takes time.


Mentorship Cycle

The mentee will pass in the 3 steps of the mentorship cycle. The first one is to be in a given situation, or having some problem or doubt.

adrianhajdin / TimeLine.jsx
Created Jun 11, 2021
Portfolio Website - JSM
View TimeLine.jsx
import React, { useState, useRef, useEffect } from 'react';
import { CarouselButton, CarouselButtonDot, CarouselButtons, CarouselContainer, CarouselItem, CarouselItemImg, CarouselItemText, CarouselItemTitle, CarouselMobileScrollNode } from './TimeLineStyles';
import { Section, SectionDivider, SectionText, SectionTitle } from '../../styles/GlobalComponents';
import { TimeLineData } from '../../constants/constants';
const TOTAL_CAROUSEL_COUNT = TimeLineData.length;
const Timeline = () => {
const [activeItem, setActiveItem] = useState(0);
maykbrito /
Created Feb 20, 2021
Generate PDF with NodeJS and Puppeteer. Using ExpressJS, EJS and TailwindCSS to create fake data server

Generate PDF

Using NodeJS and Puppeteer.

Creating a fake data server with ExpressJS, EJS and TailwindCSS.

How to use it.

  1. Add this files do any directory
  2. Run npm install
hail2u / apca.js
Last active Jan 9, 2022
Get contrast of colors using APCA (Advanced Perceptual Contrast Algorithm)
View apca.js
// Example:
// const contrast = getAPCAContrast("rgb(255, 255, 255)", "rgb(136, 136, 136)");
// This returns `66.89346308821438` (66.893%)
// > #888 vs #fff • 66.89346308821438
// 80% means 7:1 in WCAG 2.0
// 60% means 4.5:1 in WCAG 2.0
5t3ph / element-classes-and-ids-vanilla.css
Last active Jan 25, 2022
Tag HTML elements with their class names and IDs to visualize page structure
View element-classes-and-ids-vanilla.css
*[id] {
position: relative;
outline: 2px dashed red;
*[class]::before, *[class]::after,
*[id]::after {
position: absolute;
IanColdwater / twittermute.txt
Last active Nov 30, 2022
Here are some terms to mute on Twitter to clean your timeline up a bit.
View twittermute.txt
Mute these words in your settings here:

Okay, this is where I leave you.


Infinite Scroll

We have a few issues with our current Infinite Scroll:

  1. It will attach infinite elements into the DOM as is being scrolled;
  2. The code for handling it is being copy/pasted in different files to do the same thing;
  3. Some files has extra handling for no apparent reason;