Skip to content

Instantly share code, notes, and snippets.

View khadorkin's full-sized avatar

Dima Khadorkin khadorkin

  • Mobile Roadie
  • Vilnius, Lithuania
  • 05:34 (UTC +03:00)
View GitHub Profile
@khadorkin
khadorkin / fish_install.md
Created July 13, 2023 07:02 — forked from gagarine/fish_install.md
Install fish shell on macOS Mojave with brew

Installing Fish shell on MacOS (Intel and M1) using brew

Fish is a smart and user-friendly command line (like bash or zsh). This is how you can instal Fish on MacOS and make your default shell.

Note that you need the https://brew.sh/ package manager installed on your machine.

Install Fish

brew install fish

@khadorkin
khadorkin / ci-yarn-install.md
Created January 24, 2023 12:21 — forked from belgattitude/ci-yarn-install.md
Composite github action to improve CI time with yarn 3+ / node-modules linker.
import React from "react";
import { Dimensions, TextInput, ScrollView } from "react-native";
import Animated, {
useAnimatedKeyboard,
useAnimatedReaction,
runOnJS,
KeyboardState,
useAnimatedProps,
useAnimatedScrollHandler,
/*
FREE TO USE! COPY AND PASTE INTO YOUR PROJECT. TELL YOUR FRIENDS ABOUT MAPPABLE TYPES!
How to use:
install dependencies (tree shakable):
`yarn add fp-ts ts-toolbelt normalizr`
Your schema definitions should look like this:
@khadorkin
khadorkin / settings.json
Created February 17, 2022 05:08 — forked from franky47/settings.json
VSCode experimental file nesting configuration
{
"explorer.experimental.fileNesting.enabled": true,
"explorer.experimental.fileNesting.patterns": {
"*.ts": "$(capture).js, $(capture).d.ts, $(capture).test.ts",
"*.js": "$(capture).js.map, $(capture).min.js, $(capture).d.ts, $(capture).test.js",
"*.jsx": "$(capture).js",
"*.tsx": "$(capture).ts, $(capture).*.ts, $(capture).*.tsx",
"tsconfig.json": "tsconfig.*.json",
"docker-compose.yml": "docker-compose.*.yml",
".env": ".env.*",
@khadorkin
khadorkin / useReduceMotion.ts
Created February 9, 2022 16:24 — forked from martsie/useReduceMotion.ts
useReduceMotion hook for ReactNative
import { useEffect, useState } from 'react'
import { AccessibilityInfo } from 'react-native'
// Adapted from https://github.com/infiniteluke/react-reduce-motion/blob/master/src/targets/native/index.js
export const useReduceMotion = (): boolean => {
const [shouldReduceMotion, setShouldReduceMotion] = useState(false)
useEffect(() => {
const handleChange = (isReduceMotionEnabled: boolean): void => {
setShouldReduceMotion(isReduceMotionEnabled)
@khadorkin
khadorkin / xcbuild-debugging-tricks.md
Created February 4, 2022 09:16 — forked from ddunbar/xcbuild-debugging-tricks.md
Xcode new build system debugging tricks

New Build System Tricks

Command Line

alias xcbuild=$(xcode-select -p)/../SharedFrameworks/XCBuild.framework/Versions/A/Support/xcbuild
# THIS DOESNT WORK YET: xcbuild openIDEConsole  # … then switch to Xcode ➡️
xcbuild showSpecs
xcbuild build <foo.pif> [—target <target>]
@khadorkin
khadorkin / Test_CRF_Presets_For_Libx264_Encodes
Created January 23, 2022 19:36 — forked from mattst/Test_CRF_Presets_For_Libx264_Encodes
Script to test encode speeds and file sizes for libx264 encodes with a range of CRF values and presets
#!/bin/bash
infile="TestClipTwoMin.mp4"
datafile="TestClipTwoMinData.csv"
crfs=("18" "19" "20" "21" "22" "23" "24" "25" "26" "27")
presets=("ultrafast" "superfast" "veryfast" "faster" "fast" "medium" "slow" "slower" "veryslow")
echo 'CRF,Preset,Time (Secs),Size (MB)' >> "$datafile"
@khadorkin
khadorkin / App.tsx
Created January 7, 2022 18:40 — forked from intergalacticspacehighway/App.tsx
Add row/col gaps in flatlist
function App() {
const data = Array(10).fill(0);
const GAP = 5;
const numColumns = 3;
const { width } = Dimensions.get("window");
// Reduce the size to accomodate margin space by items
const ITEM_SIZE = width / numColumns - ((numColumns - 1) * GAP) / numColumns;
const renderItem = ({ index }) => {
@khadorkin
khadorkin / uuid.ts
Created November 9, 2021 17:13 — forked from YBogomolov/uuid.ts
Type-level UUID
type VersionChar =
| '1' | '2' | '3' | '4' | '5';
type Char =
| '0' | '1' | '2' | '3'
| '4' | '5' | '6' | '7'
| '8' | '9' | 'a' | 'b'
| 'c' | 'd' | 'e' | 'f';
type Prev<X extends number> =