Skip to content

Instantly share code, notes, and snippets.

View criskell's full-sized avatar

Cristiano criskell

View GitHub Profile

The Problem

Adding inner margins and padding to one component should be avoided. In one screen it may make sense to do this, but as soon as other screen doesn't require that margin, the component becomes incorrect. Do not create new components with inner margins. There are a few ways to undo this. Let's first create an incorrect example:

❌ Wrong

type ProfileCardItemProps = {
  label: string
  value: string
}
@Grubba27
Grubba27 / generic-proxy.ts
Created January 3, 2024 19:56
create your own tRPC-like api with JavaScript proxy and a little bit of ts magic
const setProxySettings = (
{
call,
filter,
}: {
call: ({ path, args }: { path: unknown; args: unknown[] }) => any;
filter: (path: string[]) => unknown;
} = {
call: ({ path, args }) => {
return {
@noghartt
noghartt / cc.md
Last active June 8, 2024 06:34
Resources to learn more about Computer Science and related stuffs
import type { V2_HtmlMetaDescriptor, V2_MetaFunction } from "@remix-run/node";
export const mergeMeta = (
overrideFn: V2_MetaFunction,
appendFn?: V2_MetaFunction,
): V2_MetaFunction => {
return arg => {
// get meta from parent routes
let mergedMeta = arg.matches.reduce((acc, match) => {
return acc.concat(match.meta || []);
@sibelius
sibelius / woovi_job.md
Last active June 4, 2024 00:39
Woovi Job Description
@sibelius
sibelius / woovi_challenge.md
Last active May 2, 2024 03:03
Woovi Challenge
@kapiljhajhria
kapiljhajhria / JEST_VITE_APP.md
Created October 19, 2021 13:25
Integrate Jest & React Testing Library in a React Vite Project.

Integrate Jest & React Testing Library in a React Vite Project

  1. Install Dependencies
yarn add --dev jest babel-jest @babel/preset-env @babel/core @babel/plugin-syntax-jsx @babel/preset-react @testing-library/dom @testing-library/jest-dom @testing-library/react @testing-library/user-event babel-preset-react-app identity-obj-proxy jest-circus jest-scss-transform jest-watch-typeahead
  1. Set Jest & babel configs in package.json
"jest": {
    "roots": [
@rexim
rexim / 0001-Make-it-possible-to-include-files-over-https.patch
Last active April 13, 2024 15:16
TCC patch that enables including files via HTTPS using CURL
From 84c42091cbae3735c52e895221f3f95a87155756 Mon Sep 17 00:00:00 2001
From: rexim <reximkut@gmail.com>
Date: Wed, 30 Jun 2021 20:43:47 +0700
Subject: [PATCH] Make it possible to include files over https
---
Makefile | 2 +-
tcc.c | 5 +++++
tccpp.c | 43 +++++++++++++++++++++++++++++++++++++++++++
3 files changed, 49 insertions(+), 1 deletion(-)