Skip to content

Instantly share code, notes, and snippets.

View okaybeydanol's full-sized avatar
🏠
Working from home

Okay BEYDANOL okaybeydanol

🏠
Working from home
  • Eteration
  • İzmir
  • 03:35 (UTC +03:00)
View GitHub Profile
{
// *******************************
// * GENERAL SETTINGS *
// *******************************
"workbench.startupEditor": "none",
"workbench.iconTheme": "material-icon-theme",
"workbench.editor.closeOnFileDelete": false,
"window.zoomLevel": 0,
"window.newWindowProfile": "Default",
"purge:js": "rm -rf node_modules package-lock.json yarn.lock && npm cache clean --force && yarn cache clean && rm -rf $TMPDIR/metro-* $TMPDIR/haste-* ~/Library/Caches/Yarn",
"purge:android": "(cd android && ./gradlew --stop) && rm -rf ~/.gradle/caches/ ~/.gradle/daemon ~/.gradle/native ~/.gradle/wrapper android/app/build",
"purge:ios": "rm -rf ios/Pods/* ios/Podfile.lock ios/build ~/Library/Caches/CocoaPods ~/Library/Developer/Xcode/DerivedData ~/Library/Developer/CoreSimulator/Caches && xcrun simctl erase all && pod cache clean --all",
"purge:gem": "rm -rf Gemfile.lock vendor/* ~/.gem && gem cleanup",
"purge:install": "yarn install && cd ios && bundle install && bundle exec pod install",
"purge": "npm run purge:js && npm run purge:android && npm run purge:ios && npm run purge:gem && npm run purge:install"
@okaybeydanol
okaybeydanol / SwipeableReanimated.tsx
Created February 21, 2025 21:57
RN: Swipeable Item with Reanimated 3 - Lightweight & Performant List Item with Swipe Actions
import React, {
forwardRef,
PropsWithChildren,
useImperativeHandle,
memo,
useMemo,
useCallback,
} from 'react';
import {
Gesture,
@okaybeydanol
okaybeydanol / SwipeableAnimated.tsx
Created February 21, 2025 21:49
RN: Swipeable Item with RN Animated - Lightweight & Performant List Item with Swipe Actions
import React, {
PropsWithChildren,
useRef,
useImperativeHandle,
forwardRef,
memo,
useCallback,
useMemo,
useEffect,
} from 'react';
@okaybeydanol
okaybeydanol / nestedKeysArray.ts
Created February 8, 2025 22:48
TypeScript: Extract Nested Object Keys as Arrays (Basic, Infer, and String-Enforced)
/**
* Recursively extracts nested keys of an object as arrays.
* Useful for representing nested object paths in an array format.
*
* Example:
* type Theme = { colors: { primary: string; secondary: { light: string; dark: string } } };
* type Paths = NestedKeyArray<Theme['colors']>;
* ["primary"] | ["secondary", "light"] | ["secondary", "dark"]
*/
export type NestedKeysArray<T> = T extends object
@okaybeydanol
okaybeydanol / numberRangeAndSubtract.ts
Created February 8, 2025 01:24
TypeScript: Number Range and Subtraction Utilities (`Enumerate` and `Subtract`)
/**
* Generates a tuple of numbers from 0 up to (but not including) N.
* Used internally for numeric operations like subtraction.
*
* Example:
* type Numbers = Enumerate<3>; // [0, 1, 2]
*/
export type Enumerate<
N extends number,
Acc extends number[] = [],
@okaybeydanol
okaybeydanol / nestedKeysPathsWithDepth.ts
Created February 8, 2025 01:16
TypeScript: Extract Nested Object Keys with Depth Limit (With and Without Infer)
/**
* Generates a tuple of numbers from 0 up to (but not including) N.
* Used internally for numeric operations like subtraction.
*
* Example:
* type Numbers = Enumerate<3>; // [0, 1, 2]
*/
type Enumerate<
N extends number,
Acc extends number[] = [],
@okaybeydanol
okaybeydanol / nestedDotNotationPaths.ts
Created February 8, 2025 01:11
TypeScript: Extract Nested Object Keys as Dot-Notation Strings (With and Without Infer)
/**
* Recursively extracts nested keys of an object as dot-notation strings.
* Useful for representing nested object paths in a string format.
*
* Example:
* type Theme = { colors: { primary: string; secondary: { light: string; dark: string } } };
* type Paths = NestedDotNotationPaths<Theme['colors']>;
* "primary" | "secondary.light" | "secondary.dark"
*/
export type NestedDotNotationPaths<T> = T extends object