Skip to content

Instantly share code, notes, and snippets.

View hamatoyogi's full-sized avatar

Yoav Ganbar hamatoyogi

View GitHub Profile
@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) =>
@alexilyaev
alexilyaev / . README.md
Last active May 18, 2022 15:16
Setup ESLint with Prettier

ESLint with Prettier Setup

Basically, when using Prettier, all ESLint styling rules should be disabled.
This can be done with eslint-config-prettier.

See .eslintrc.js example below.
In prettier.config.js you can use anything you want (see example below).

Now the tricky part is how to run them...
Usually ESLint should run first, then Prettier.

const bypass = [
// function names to avoid logging
];
const collapsed = [
// function names to groupCollapsed
];
module.exports = function(babel) {
const { types: t } = babel;
const wrapFunctionBody = babel.template(`{
@WebReflection
WebReflection / custom-elements-pattern.md
Last active April 29, 2025 19:25
Handy Custom Elements' Patterns

Handy Custom Elements' Patterns

Ricardo Gomez Angel Photo by Ricardo Gomez Angel on Unsplash

This gist is a collection of common patterns I've personally used here and there with Custom Elements.

These patterns are all basic suggestions that could be improved, enriched, readapted, accordingly with your needs.

@remy
remy / curl-format.txt
Created February 8, 2017 12:29
alias perf='curl -w "@$HOME/curl-format.txt" -o /dev/null -s '
namelookup: %{time_namelookup}\n
connect: %{time_connect}\n
appconnect: %{time_appconnect}\n
pretransfer: %{time_pretransfer}\n
redirect: %{time_redirect}\n
starttransfer: %{time_starttransfer}\n
----------\n
total: %{time_total}\n
@DarrenN
DarrenN / get-npm-package-version
Last active June 20, 2025 19:20 — forked from yvele/get-npm-package-version.sh
Extract version from package.json (NPM) using bash / shell
# Version key/value should be on his own line
PACKAGE_VERSION=$(cat package.json \
| grep version \
| head -1 \
| awk -F: '{ print $2 }' \
| sed 's/[",]//g')
echo $PACKAGE_VERSION
@alexilyaev
alexilyaev / NewMacGuidelines.md
Last active July 3, 2025 13:01
New Mac Guidelines

New Mac Guidelines

Setup

  • Make sure Git is installed and latest
    • git --version
    • git config --global user.name "NAME_HERE"
    • git config --global user.email "EMAIL_HERE"
  • Install Dropbox
  • Used for syncing configs between several computers
@staltz
staltz / introrx.md
Last active July 7, 2025 10:24
The introduction to Reactive Programming you've been missing