Skip to content

Instantly share code, notes, and snippets.

View pratikdevdas's full-sized avatar
🏠
Working from home

Pratik Dev Das pratikdevdas

🏠
Working from home
View GitHub Profile
import { useVideoAssets } from '@/containers/VideoContainer/VideoAssetsContainer/VideoAssetsContainer.hook'
import TermsCheckbox from './Shared/TermsCheckbox'
import { TextInput, Button } from '@tremor/react';
import { Input } from './Shared/RawInputTremor';
const UploadSingleContentForm = ({setIsDialogOpen, parent, setUploadView}) => {
const contentSubmission = async(e) => {
try {
@pratikdevdas
pratikdevdas / togglabe.tsx
Created December 30, 2023 22:44
forwardref with useImperativeHandle
/* eslint-disable react/display-name */
import React, { forwardRef, useImperativeHandle, useRef, useState } from 'react'
const NoteForm = ({ createNote }) => {
const [newNote, setNewNote] = useState('')
const addNote = (event) => {
event.preventDefault()
createNote({
@pratikdevdas
pratikdevdas / debounced-search.tsx
Last active August 26, 2023 09:34 — forked from tomslutsky/debounced-search.tsx
supports v2 and updated a few hooks
import { useEffect, useState } from "react";
import {
LoaderFunction,
useLoaderData,
useSubmit,
useSearchParams,
useNavigation
} from "@remix-run/react";
import { useDebounce } from './useDebounce';
import { LoaderArgs, json } from "@remix-run/node";
@pratikdevdas
pratikdevdas / keybinding.json
Last active July 3, 2023 18:58
Vscode settings 2023 - July
// Place your key bindings in this file to override the defaultsauto[]
[
{
"key": "ctrl+shift+q",
"command": "workbench.action.terminal.kill"
},
{
"key": "ctrl+shift+alt+n",
"command": "explorer.newFolder",
"when": "explorerViewletFocus"
@pratikdevdas
pratikdevdas / index.tsx
Last active June 15, 2023 23:24
Fetching data from external api in remix. This code only runs on server side. Genres from TMDB has been used using a env hiding the Auth Token.
import { json, type V2_MetaFunction } from '@remix-run/node'
import { useLoaderData } from '@remix-run/react'
export const meta: V2_MetaFunction = () => {
return [
{ title: 'New Remix App' },
{ name: 'description', content: 'Welcome to Remix!' }
]
}
@pratikdevdas
pratikdevdas / distanceformula.js
Created July 26, 2022 08:32
Mathematics with js
let x1, y1, x2, y2, result;
x1 = prompt('x1');
y1 = prompt('y1');
x2 = prompt('x2');
y2 = prompt('y2');
result = Math.sqrt(Math.pow((x2 - x1),2)+Math.pow((y2 - y1),2));
console.log(result.toFixed(4))
@pratikdevdas
pratikdevdas / .eslintignore
Last active June 27, 2022 18:25
eslint(only) for nodejs
node_modules
build
@pratikdevdas
pratikdevdas / reactlocal.json
Last active June 27, 2022 18:29
Onsave formatting for react which uses prettier and es-lint both
{
"emmet.includeLanguages": {
"javascript": "javascriptreact"
},
"emmet.triggerExpansionOnTab": true,
"editor.codeActionsOnSave": {
//eslint-runs-automatically-on-save
"source.fixAll.eslint": true
},
"eslint.validate": [
@pratikdevdas
pratikdevdas / .eslintignore
Last active December 18, 2023 23:28
eslint & Prettier 05/04/2022 for React
node_modules
build
.eslintrc.js
.prettierrc.js
.eslintcache
@pratikdevdas
pratikdevdas / settings.json
Last active April 2, 2022 23:44
Vscode settings
//global settings of my vs code
{
"workbench.activityBar.visible": true,
"explorer.confirmDelete": false,
"liveServer.settings.donotShowInfoMsg": true,
"liveServer.settings.donotVerifyTags": true,
"files.associations": {
"*.js": "javascript"
},