Skip to content

Instantly share code, notes, and snippets.

View RajaJaganathan's full-sized avatar
🎯
Focusing

Raja Jaganathan RajaJaganathan

🎯
Focusing
View GitHub Profile
@RajaJaganathan
RajaJaganathan / tasks.json
Created June 30, 2023 13:29 — forked from grabbou/tasks.json
A simple example of launching two long-running processes within Visual Studio Code to make working in monorepo easier
{
"version": "2.0.0",
"tasks": [
{
"label": "Start Expo dev server",
"type": "shell",
"command": "cd ./apps/mobile && yarn start",
"presentation": {
"reveal": "always",
"panel": "new",
@jbsulli
jbsulli / pnp typescript.md
Last active March 21, 2024 16:24
Typescript Yarn 3 Plug'n'Play zero-install monorepo for VSCode

Setup nvm

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
source ~/.bashrc

Setup node

@grabbou
grabbou / tasks.json
Last active June 30, 2023 13:29
A simple example of launching two long-running processes within Visual Studio Code to make working in monorepo easier
{
"version": "2.0.0",
"tasks": [
{
"label": "Start Expo dev server",
"type": "shell",
"command": "cd ./apps/mobile && yarn start",
"presentation": {
"reveal": "always",
"panel": "new",
@char0n
char0n / LICENSE
Last active February 2, 2023 00:29
Advanced memoization for JavaScript functions with lodash.memoize
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
@tannerlinsley
tannerlinsley / createCrudHooks.js
Created November 29, 2020 06:39
A naive, but efficient starter to generate crud hooks for React Query
export default function createCrudHooks({
baseKey,
indexFn,
singleFn,
createFn,
updateFn,
deleteFn,
}) {
const useIndex = (config) => useQuery([baseKey], indexFn, config)
const useSingle = (id, config) =>
@calebporzio
calebporzio / pure_html_css_modal.css
Last active February 28, 2022 18:15
The CSS for the pure HTML/CSS modal I tweeted about.
details summary {
cursor: pointer;
outline: none !important;
display: inline-block;
padding: 8px 12px;
padding-top: 10px;
border-radius: 4px;
overflow: hidden;
background: #F09825;
color: white;
import PropTypes from 'prop-types';
type Omit<T, K> = Pick<T, Exclude<keyof T, K>>;
type Defined<T> = T extends undefined ? never : T;
/**
* Get the type that represents the props with the defaultProps included.
*
* Alternatively, we could have done something like this:
@dphrag
dphrag / ErrorFocus.jsx
Created November 1, 2018 23:41
Formik Scroll To First Invalid Element W/O Refs
import React from 'react';
import { connect } from 'formik';
class ErrorFocus extends React.Component {
componentDidUpdate(prevProps) {
const { isSubmitting, isValidating, errors } = prevProps.formik;
const keys = Object.keys(errors);
if (keys.length > 0 && isSubmitting && !isValidating) {
const selector = `[id="${keys[0]}"]`;
const errorElement = document.querySelector(selector);

Hi, looks like this code fragment from your blog at: https://rclayton.silvrback.com/custom-errors-in-node-js

// I do something like this to wrap errors from other frameworks.
class InternalError extends DomainError {
  super(error.message);
  this.data = { error };
}

should be modified to have a constructor that takes that error from other frameworks like this?

@loganpowell
loganpowell / graphql-args-passing.md
Last active June 8, 2023 17:51
GraphQL Passing Arguments (parent, args, context, info)