Skip to content

Instantly share code, notes, and snippets.

View techtony92's full-sized avatar

Tony techtony92

  • Baltimore, MD
View GitHub Profile
@techtony92
techtony92 / Toast.tsx
Created March 9, 2026 00:02 — forked from JoeEverest/Toast.tsx
React Native Toast component
import React, { createContext, useContext, useRef, useState } from "react";
import { View, StyleSheet, Animated, Platform } from "react-native";
import { useSafeAreaInsets } from "react-native-safe-area-context";
import { Text } from "./Text";
import { Check, Info, AlertCircle } from "lucide-react-native";
type ToastType = "success" | "error" | "info" | "subtle";
type ToastConfig = {
message: string;
// Run this command to generate base config and vs code settings:
// pnpm dlx @antfu/eslint-config@latest
import antfu from "@antfu/eslint-config";
export default antfu({
type: "app",
typescript: true,
formatters: true,
stylistic: {
@techtony92
techtony92 / OpacityHex.markdown
Created January 29, 2025 19:25 — forked from passiondroid/OpacityHex.markdown
Opacity percentage in a Hex color code

Android uses hexadecimal ARGB values, which are formatted as #AARRGGBB. That first pair of letters, the AA, represent the alpha channel. You must convert your decimal opacity values to a hexadecimal value. Here are the steps:

Alpha Hex Value Process

  • Take your opacity as a decimal value and multiply it by 255. So, if you have a block that is 50% opaque the decimal value would be .5. For example: .5 x 255 = 127.5

  • The fraction won't convert to hexadecimal, so you must round your number up or down to the nearest whole number. For example: 127.5 rounds up to 128; 55.25 rounds down to 55.

  • Enter your decimal value in a decimal-to-hexadecimal converter, like http://www.binaryhexconverter.com/decimal-to-hex-converter, and convert your values.

@techtony92
techtony92 / Creating a Webpack config written in typescript , with VScode supporting Yarn PnP
Created September 26, 2024 05:31
Using Typescript For A Webpack Configuration File using NVM & Yarn with PnP
Steps to use Typescript for a Webpack configuarion file:
1) For VSCode, make sure your window is opened to the containing workspace folder directly.
2) Install yarn via corepack and set your version.
3) Set up a yarnrc.yml to contain fields: nodeLinker: pnp, pnpMode: loose & yarnPath
(for some reason my yarn path wasn't populating nor was the releases folder being created with the respective yarn cjs version file,
so you may need to create the releases folder : .yarn/releases/ --> yarn-version number.cjs. If you don't have this file,
you need to download it. Thats what i did and my version was yarn 4.5.0).
4) Install required dependencies: typescript ts-node @types/node @types/webpack
4.2) Run yarn tsc --init to create a tsconfig.json file and modify the following rulesets inside the top level compiler options:
"rootDir": "./",