Skip to content

Instantly share code, notes, and snippets.

View khadorkin's full-sized avatar

Dima Khadorkin khadorkin

  • Mobile Roadie
  • Vilnius, Lithuania
  • 20:32 (UTC +03:00)
View GitHub Profile
@khadorkin
khadorkin / usage.tsx
Created January 23, 2025 20:41 — forked from Makisuo/usage.tsx
Pglite x Drizzle Live Query
const { data: accounts } = useDrizzleLive((db) =>
db.query.accounts.findMany({
limit: 100,
with: {
institution: true,
},
}),
)
@khadorkin
khadorkin / skeleton.tsx
Created October 24, 2024 12:06 — forked from EvanBacon/skeleton.tsx
Animated skeleton component with Expo SDK 52
"use client";
import React from "react";
import { View, StyleSheet, Animated, Easing, ViewStyle } from "react-native";
const BASE_COLORS = {
dark: { primary: "rgb(17, 17, 17)", secondary: "rgb(51, 51, 51)" },
light: {
primary: "rgb(250, 250, 250)",
secondary: "rgb(205, 205, 205)",
@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"