This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set nocompatible " be iMproved, required | |
filetype off " required | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" ------------------------------ PLUGINS ------------------------------ | |
Plugin 'VundleVim/Vundle.vim' " let Vundle manage Vundle, required |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
mkdir project_name | |
cd project_name | |
npm init -y | |
Install: | |
- react | |
- react-dom | |
- typescript (optional) | |
- bundler (vite or webpack) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
"include": [".eslintrc.cjs", ".prettierrc.cjs"], | |
"compilerOptions": { | |
/* LANGUAGE COMPILATION OPTIONS */ | |
"target": "ES2020", | |
"lib": ["DOM", "DOM.Iterable", "ES2020"], | |
"module": "Node16", | |
"moduleResolution": "nodenext", | |
"resolveJsonModule": true, | |
"allowJs": true, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { describe, expect, it } from "bun:test" | |
import { Singleton } from "./singleton" | |
describe("@Singleton", () => { | |
it("makes class singleton", () => { | |
@Singleton | |
class Foo { | |
constructor(public bar: string) {} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function timeAgo(time: number, now = Date.now()) { | |
const is = (interval: number, cycle: number) => | |
cycle >= interval ? Math.round(cycle / interval) : 0 | |
const secs = (now - time) / 1000 | |
const mins = is(60, secs) | |
const hours = is(60, mins) | |
const days = is(24, hours) | |
const weeks = is(7, days) |