Skip to content

Instantly share code, notes, and snippets.

View farzd's full-sized avatar
🌍
Available for hire

Farzad Qasim farzd

🌍
Available for hire
  • Remote
  • 03:55 (UTC)
View GitHub Profile
@mfehrenbach
mfehrenbach / chrome-device-dimensions.md
Last active May 15, 2026 22:09
Modern device dimensions for Chrome DevTools.

Modern Device Dimensions for Chrome DevTools

These are modern “Emulated Devices” (a.k.a. responsive dimensions) for Chrome DevTools’ Mobile Device Viewport Mode.

They are specifically Apple devices, subtracting for recent Safari UI (as in window.innerWidth/Height), and cleverly sorted with some dark-arts unicode shenanigans. (This glitchy, unloved portion of the tools sorts lexicographically, because of course it would.) Ergonomics!

 

Note

Updated June 2025 with some notes from folks below! TL;DR: use Vibranium!

@marcus-at-localhost
marcus-at-localhost / _mind-the-gap-css-grid-hide-a-column.markdown
Last active December 1, 2021 18:08
[Mind the Gap - CSS Grid Hide a Column] #css #grid #column

Mind the Gap - CSS Grid Hide a Column

Depending on how the CSS grid is set up, you can't just hide a column and reflow the rest of the grid. If the column has a fixed with, the space is preserved, if the column width is 0 after hiding the grid gap adds up. The only way to fix it is to reflect the changes in the grid template.

A Pen by Marcus Obst on CodePen.

License.

@stevecastaneda
stevecastaneda / CSSTransition.tsx
Created June 10, 2020 02:44
A CSS Transition component to use as a child of TransitionGroup.
// http://reactcommunity.org/react-transition-group/transition
// http://reactcommunity.org/react-transition-group/transition-group
import React, { ReactNode } from "react";
import { Transition as ReactTransition } from "react-transition-group";
interface TransitionProps {
in?: boolean;
timeout: number | { appear?: number; enter?: number; exit?: number };
enter?: string;
@stevecastaneda
stevecastaneda / ModalExample.tsx
Last active July 26, 2020 20:17
[Typescript] Modified Transition React Component to Support Nested Transitions w/ Tailwind
// Modal Source: https://tailwindui.com/components/application-ui/overlays/modals
import React, { ReactNode } from "react";
import { Transition } from "components/transition";
interface Props {
/** The modal open/close state */
open: boolean;
}
@GavinRay97
GavinRay97 / index.md
Last active April 12, 2024 18:31
Hasura organization permissions

Introduction

This document outlines how to model a common organization-based permission system in Hasura. Let's assume that you have some table structure like the following:

Table Name Columns Foreign Keys
User id, name, email
Organization User id, user_id, organization_id user_id -> user.id, organization_id -> organization.id
Organization id, name
@gustavwennerblom
gustavwennerblom / gist:b17a6b8c12a6e10f88306ad3e42f26bd
Last active March 9, 2025 19:57
Adding prettier to a CRA project

Adding prettier to a CRA project

Previously, I've had some problem to reliaby configure code formatting with Prettier in VSCode, in the context of a create-react-app proejct. Today, it worked like a charm, and this is what I did.

Preconditions:

  • react-scripts: "3.1.1"
  • react: "^16.9.0"
  • react-dom: "^16.9.0"
  • Dirk Baeumer's ESLint VSCode extension installed and running
@elijahmanor
elijahmanor / .eslintrc
Last active August 16, 2021 20:29
Add Prettier & ESLint to VS Code with a Create React App
{
"extends": ["react-app", "plugin:prettier/recommended"]
}
@OlegIlyenko
OlegIlyenko / Event-stream based GraphQL subscriptions.md
Last active April 29, 2026 22:22
Event-stream based GraphQL subscriptions for real-time updates

In this gist I would like to describe an idea for GraphQL subscriptions. It was inspired by conversations about subscriptions in the GraphQL slack channel and different GH issues, like #89 and #411.

Conceptual Model

At the moment GraphQL allows 2 types of queries:

  • query
  • mutation

Reference implementation also adds the third type: subscription. It does not have any semantics yet, so here I would like to propose one possible semantics interpretation and the reasoning behind it.

@staltz
staltz / introrx.md
Last active May 16, 2026 20:29
The introduction to Reactive Programming you've been missing
@stuart11n
stuart11n / gist:9628955
Created March 18, 2014 20:34
rename git branch locally and remotely
git branch -m old_branch new_branch # Rename branch locally
git push origin :old_branch # Delete the old branch
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote