Skip to content

Instantly share code, notes, and snippets.

Avatar

Erko Bridee erkobridee

View GitHub Profile
View sanitizeFilename.ts
// it also supports extensions like .tar.gz
export const getFileExtension = (filename: string) =>
(filename.match(/(\.([^.]*?)(\.([^.]*?))?)(?=\?|#|$)/) || [])[1] ?? "";
//---===---//
/* eslint-disable */
const SANITIZE_FILENAME_REGEXP = {
NO_LEFT_SPACES: /^\s+/g,
NO_SEQ_DOTS: /\.+/g,
@erkobridee
erkobridee / add_to_calendar.md
Created June 28, 2023 07:30
useful information of how to generate ics files or google calendar urls to add events to the calendar
View add_to_calendar.md
@erkobridee
erkobridee / ts-use_consts_instead_of_enums.ts
Last active January 13, 2023 08:46
a sample code of how to use const as const instead of enums in TypeScript
View ts-use_consts_instead_of_enums.ts
/*
from:
Enums considered harmful | Matt Pocock
https://www.youtube.com/watch?v=jjMbPt_H3RQ
*/
const LogLevel = {
DEBUG: "DEBUG",
INFO: "INFO",
View 01_learning_tips.md

"Any sufficiently advanced technology is indistinguishable from magic." by - Arthur C. Clarke | CCCB LAB

Arthur C. Clarke was a scientist, science writer and author of science fiction stories and novels. This quote of his reflects on the early beginnings of technology and offers us a way of linking up the two exhibitions that have been held this year at the CCCB: Black Light and Stanley Kubrick.

this quote it's also refered on [YouTube] Why Magic Systems don't feel Magical | Tale Foundry - 2023-05-31

Learning