This file contains hidden or 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
| create table emojies( | |
| name text | |
| ); | |
| INSERT INTO emojies VALUES('👻'), ('👺'), ('👹'), ('🤡'), ('🏚️'), ('🛸') | |
| select * from emojies | |
| JOIN UNNEST(ARRAY['🛸', '👻', '👺', '🏚️', '👹', '🤡']) WITH ORDINALITY my_order_table("name", "ordinality_order") USING("name") | |
| ORDER BY "ordinality_order" |
This file contains hidden or 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 axios, { AxiosResponse } from 'axios' | |
| import { v4 as uuidv4 } from 'uuid' | |
| export type PromiseStatus<T> = { | |
| promise: Promise<T> | |
| isFulfilled: boolean | |
| isRejected: boolean | |
| } |
This file contains hidden or 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 axios, { AxiosResponse } from 'axios' | |
| type TODO = { | |
| userId: number | |
| id: number | |
| title: string | |
| completed: boolean | |
| } | |
| const DEFAULT_TIMEOUT = 200 |
This file contains hidden or 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 PromiseQueue from 'p-queue' | |
| import got, { Request } from 'got' | |
| import colors from '@jshor/colors' | |
| console.clear() | |
| let counter = 0 | |
| let errorCounter = 0 | |
| const { bold, green, red } = colors |
This file contains hidden or 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
| const magicObject = new Proxy( | |
| {}, | |
| { | |
| get(_, prop) { | |
| return new Proxy({ [prop]: 'hmmm?' }, this) | |
| }, | |
| } | |
| ) | |
This file contains hidden or 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
| const refKeeperMapFactory = (() => { | |
| type RefMap = Map<string, Record<string, any>> | |
| let refKeeper: RefMap | |
| return () => { | |
| if (refKeeper) { | |
| return refKeeper | |
| } | |
| const mapProxyHandler = { | |
| get(target: RefMap, name: string) { | |
| const functionOrValue = Reflect.get(target, name) |
This file contains hidden or 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
| CREATE TABLE IF NOT EXISTS artices ( | |
| id serial PRIMARY KEY, | |
| title VARCHAR (50) NOT NULL, | |
| slug VARCHAR (255) NOT NULL, | |
| deleted_at TIMESTAMP NULL, | |
| created_on TIMESTAMP not NULL DEFAULT NOW() | |
| ); | |
| CREATE UNIQUE INDEX IF NOT EXISTS unique_slug |
This file contains hidden or 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.prototype.pipe = function (start, ...funcs) { | |
| return funcs.reduce((prev, func) => func(prev), start) | |
| } | |
| const func01 = (prev) => prev + 1 | |
| const func02 = (prev) => prev + 1 | |
| const func03 = (prev) => prev + 1 | |
| const func04 = (prev) => prev + 1 | |
| const func05 = (prev) => prev + 1 |
This file contains hidden or 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 React, { useState } from 'react' | |
| import ReactDOM from 'react-dom' | |
| import { Button } from 'rsuite' | |
| import 'rsuite/dist/styles/rsuite-dark.css' | |
| import { generate } from 'shortid' | |
| import User from './User' | |
| import Viewer from './Viewer' | |
| const App = () => { | |
| const [users, setUsers] = useState([ |
This file contains hidden or 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 { | |
| createSlice, | |
| createEntityAdapter, | |
| createAsyncThunk, | |
| } from '@reduxjs/toolkit' | |
| export const fetchData = createAsyncThunk( | |
| 'users/fetchData', | |
| async (_, { dispatch }) => { | |
| const data = await fetch('http://localhost:3001/users').then((res) => |
NewerOlder