Skip to content

Instantly share code, notes, and snippets.

View gioragutt's full-sized avatar

Giora Guttsait gioragutt

View GitHub Profile
@gioragutt
gioragutt / links.md
Created July 13, 2023 13:45
Implementing Disconnect All Debug Sessions command in VSCode
@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}]`;
}
@gioragutt
gioragutt / example-for-facebook1.ts
Last active August 2, 2021 20:42
Example for facebook
const smallArray: string[] = []; // initial value IDK?
// unless you need to update the array itself, you can leave with the set.
// If you need to update the array, you can do that close to actions on the set.
const smallSet = new Set<string>(smallArray);
addEventListener('new-array-to-compare', (bigArray: string[]) => {
for (const value of bigArray) {
if (smallSet.delete(value)) {
// value was in smallSet and was deleted
@gioragutt
gioragutt / video_activity.json
Created August 2, 2021 10:53
video_activity
[
null,
null,
[4],
[26],
1617712224719887,
"AODP23YAAAAiUiAIHRCA6NzY_-fvAhj_p7rHwervAjoKCJqUgdaP_fWPZYKq8GJhyNufIGMobYdaxGb11CPJ",
"AODP23YAAAATChEIzQEQl9uUJBiPqIPUz-nvAvgaUiH-QF1r6sbp1CQSdAdoe2ac",
[
"YouTube",
@gioragutt
gioragutt / json-utils.ts
Created June 22, 2021 19:17
Boilerplate for extendable ES6/MobX compatible JSON replacer/reviver
import {isObservableMap, isObservableSet} from 'mobx';
interface Adapter {
is: (value: unknown) => boolean;
serialize: (value: any) => any;
deserialize: (value: any) => any;
}
const spread = (value: any) => [...value];
@gioragutt
gioragutt / expected-implementation.ts
Last active June 21, 2021 19:20
Example for my custom json parse/stringify reviver/replacer
import {isObservableMap, isObservableSet, observable} from 'mobx';
const DATA_TYPE_FIELD = '___jsonDataType';
function getCollectionTypeName(value: any): 'Set' | 'Map' | 'ObservableSet' | 'ObservableMap' | undefined {
if (isObservableMap(value)) {
return 'ObservableMap';
}
if (isObservableSet(value)) {
return 'ObservableSet';
}