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
@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 / 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 / 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 / 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({
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 {