Skip to content

Instantly share code, notes, and snippets.

View gioragutt's full-sized avatar

Giora Guttsait gioragutt

View GitHub Profile
@gioragutt
gioragutt / examples.md
Last active July 25, 2025 16:51
How do deal with rebasing multiple branches on top of one another

I had several branches in a stack:

* feature-part-4 (HEAD)
* feature-part-3
* feature-part-2
* feature-part-1
* main
@gioragutt
gioragutt / scroller.scss
Created November 17, 2024 17:52
scroller with padding on both sides
@mixin _scrollerThumb($size, $color) {
&::-webkit-scrollbar-thumb {
border: ($size / 3) var(--border-style) transparent;
border-radius: var(--border-radius-small);
background-color: $color;
background-clip: content-box;
-webkit-background-clip: content-box;
}
&::-webkit-scrollbar-thumb:hover {
export function setAbortableTimeout(
callback: (...args: any[]) => void,
delayInMilliseconds: number,
signal: AbortSignal,
...args: any[]
) {
if (!signal) {
return setTimeout(callback, delayInMilliseconds, ...args);
}
@gioragutt
gioragutt / paramutations.ts
Created May 9, 2024 07:21
Paramutations - parameter permutation utility
type VariadicTupleOfVariadicTuples = readonly [...(readonly [...(readonly unknown[])])];
type ProductResult<T extends VariadicTupleOfVariadicTuples> = {
// @ts-expect-error should be good
[K in keyof T]: T[K][number];
};
function product<T extends VariadicTupleOfVariadicTuples>(arrays: T): ProductResult<T> {
return arrays.reduce(
@gioragutt
gioragutt / spec.md
Created May 25, 2023 07:18
IDEA - Tooling Adoption Tracking Platform

What it is?

It should be a tool that's used by developers to help adopt tooling.

Motivation

When adopting something new, or experimenting with a new tool, it is important to keep track of the experiences, good or bad, of using the tool and the consquences of it.

What could be nice for the tool to do:

@gioragutt
gioragutt / yad2-sucks-a-little-less-with-this.js
Created July 15, 2022 20:51
yad2 tampermonkey userscript
// ==UserScript==
// @name Yad2 Fixes
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.yad2.co.il/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=co.il
// @grant none
// ==/UserScript==
@gioragutt
gioragutt / .commitlintrc.js
Last active May 21, 2022 20:28
setting up nx-pwm
/**
* @type {import('@commitlint/types').UserConfig}
*/
module.exports = {
extends: ['@commitlint/config-conventional', '@commitlint/config-nx-scopes'],
rules: {
// NOTE: uncomment this if you want to alter the scopes
// 'scope-enum': async (ctx) => {
// const projects =
// require('@commitlint/config-nx-scopes').utils.getProjects(ctx);
@gioragutt
gioragutt / hack.ts
Last active December 8, 2021 18:53
nestjs swagger helper for extracting inline schemas to the document schemas
/* eslint-disable @typescript-eslint/no-explicit-any */
import { getSchemaPath, OpenAPIObject } from '@nestjs/swagger';
import _set from 'lodash.set';
import _get from 'lodash.get';
function flattenObject(theObject: any): Record<string, any> {
const toReturn: any = {};
for (const objectKey in theObject) {
declare namespace Cypress {
interface Chainable {
tid: Cypress.Chainable['get'];
}
}
function attributeSelector(key: string, value: string) {
return `[${key}=${value}]`;
}