Skip to content

Instantly share code, notes, and snippets.

Avatar

Erko Bridee erkobridee

View GitHub Profile
@erkobridee
erkobridee / nextjs_contentlayer_obsidian.md
Last active Jun 30, 2022
create/manage notes > process > publish
View nextjs_contentlayer_obsidian.md
@erkobridee
erkobridee / json_partitions_dirs_db.md
Created Jun 28, 2022
json store in multiple files - key / value pattern
View json_partitions_dirs_db.md
View react_function_component_template.tsx
import * as React from 'react';
export interface ComponentNameProps {
className?: string;
// other properties
}
export const ComponentName: React.FunctionComponent<ComponentNameProps> = ({ className }) => {
// internal logic
View nextjs_ga_route-change_sample.ts
import * as React from 'react';
import { useRouter } from 'next/router';
//----------------------------------------------------------------------------//
const isBrowser = window !== undefined;
type Gtag = (...args: any[]) => void;
export interface IGoogleAnalyticsPageView {
View bubblesort.ts
// Type level bubble sort algorithm
// https://twitter.com/anuraghazra
type BubbleSort<
A extends any[],
Curr extends number = A["length"]
> = Curr extends 1
? A
: A extends [infer F, infer S, ...infer Rest]
? BubbleSort<
@erkobridee
erkobridee / git_commit_messages.md
Created Apr 4, 2022
git commit message pattern that I follow
View git_commit_messages.md

Git Commit Messages

about the commit messages used, it follows the pattern

{TICKED ID} {type}(optional scope): short description

optional body

optional footer
View js_fake-mock_data.md

useful tools to generate fake or do mock data

Fake Image

@erkobridee
erkobridee / _functions-overloads.md
Last active Mar 16, 2022
simple example of how to define functions overloads on typescript
View good_morning.md

Good morning 🇺🇸 / Bom Dia 🇧🇷 / Buenos Dias 🇪🇸 / Bonjour 🇫🇷 / Buongiorno 🇮🇹 / Gudde Moien 🇱🇺 / Guten Morgen 🇩🇪 / Ohayōgozaimasu ( おはようございます ) 🇯🇵 / Zǎoshang hǎo ( 早上好 ) 🇨🇳

@erkobridee
erkobridee / get_YT_video_publishDate.js
Last active Mar 11, 2022
20220311 - query selector to get the youtube video published date
View get_YT_video_publishDate.js
//
document.querySelector('#info-strings yt-formatted-string.style-scope.ytd-video-primary-info-renderer').innerText
// or
document.querySelector('meta[itemprop="datePublished"]').content
// or