Skip to content

Instantly share code, notes, and snippets.

View WarrenBuffering's full-sized avatar

WarrenBuffering WarrenBuffering

  • South Dakota
  • 00:51 (UTC -06:00)
View GitHub Profile
import type { DropdownOption } from '../types';
import { useRef, useState, useEffect } from 'react';
/*================================================================================
= Core Types =
================================================================================*/
export enum InputStatus {
PENDING = 'pending',
VALID = 'valid',
@WarrenBuffering
WarrenBuffering / action-hook.txt
Last active April 16, 2025 18:18
neovim template thing
import { useFetchStatus } from "hooks";
import { ${SERVICE_NAME} } from "services";
import type {
${PASCAL_SERVICE_NAME}Params,
${PASCAL_SERVICE_NAME}Data,
${PASCAL_SERVICE_NAME}Response,
} from "services";
import type { StoreAction } from "types";
@WarrenBuffering
WarrenBuffering / useInputValue.ts
Created February 17, 2025 23:41
useInputValue.ts
import { useCallback, useState } from 'react';
import { InputStatus } from '../enums';
import type { InputState } from '../types'
type callback = () => unknown
type InputReturn<T> = {
clearAll(): void;
clearMessage(): void;
@WarrenBuffering
WarrenBuffering / faster_compress_video
Last active August 22, 2024 19:38 — forked from trvswgnr/compress_video
portable shell script to compress videos with ffmpeg
#!/bin/sh
print_usage() {
echo "usage: compress_video <input_file>"
echo "supported formats: mp4, webm, mkv, mov, avi, flv"
}
get_extension() {
f="${1##*/}"
case "$f" in
import React, { Component } from 'react'
import { Animated, Dimensions, Easing, PanResponder, SafeAreaView, StyleSheet, Text, View } from 'react-native'
import { connect } from 'react-redux'
import FastImage from 'react-native-fast-image'
// Actions & Selectors
import { setCurrComp, setNextComp, setPrevComp } from '../actions'
import { getCurrComp, getNextComp, getPrevComp } from '../selectors/comps'
import { getActiveProject } from '../selectors/projects'
@WarrenBuffering
WarrenBuffering / gist:f4be4a282dd3922f4325098811464a78
Created April 29, 2024 04:58
Fetch Util w/ Exponential Backoff
import { StatusMessage } from '../constants';
import { isObject } from '../utils/isObject';
import type { RequestResponse } from '../types';
export type RequestParams = {
body?: BodyInit;
credentials?: RequestCredentials;
headers?: HeadersInit;
integrity?: string;
@WarrenBuffering
WarrenBuffering / useFetchStatus.ts
Last active September 4, 2023 23:47
goated hooks
import { useCallback, useMemo, useState } from 'react';
import { FetchStatus } from '../enums';
export function useFetchStatus() {
const [errorCode, setErrorCode] = useState<number | null>(null);
const [errorMessage, setErrorMessage] = useState<string>('');
const [status, setStatus] = useState<FetchStatus>(FetchStatus.UNFETCHED);
const fail = useCallback((message: string, code?: number) => {