Skip to content

Instantly share code, notes, and snippets.

View bduyng's full-sized avatar

Duy Bao Nguyen bduyng

View GitHub Profile
@Solarin-Johnson
Solarin-Johnson / InteractiveButton.tsx
Created June 23, 2025 18:20
Heat Button Component for react native(expo) and reanimated
import { Pressable, StyleProp, StyleSheet, ViewStyle } from "react-native";
import React, { memo } from "react";
import Animated, {
runOnJS,
useAnimatedReaction,
useAnimatedStyle,
useDerivedValue,
useSharedValue,
withTiming,
Easing,
"use client";
import {
Dialog,
DialogContent,
DialogTitle,
DialogTrigger
} from "@/components/ui/dialog";
import useDragDrop from "@/hooks/useDragDrop";
import { cn, formatBytes } from "@/lib/utils";
@jh3y
jh3y / gsap-eases.css
Last active September 18, 2025 21:12
GreenSock eases with CSS linear()
:root {
--none: linear(0, 1);
--power1-in: linear( 0, 0.0039, 0.0156, 0.0352, 0.0625, 0.0977, 0.1407, 0.1914, 0.2499, 0.3164, 0.3906 62.5%, 0.5625, 0.7656, 1 );
--power1-out: linear( 0, 0.2342, 0.4374, 0.6093 37.49%, 0.6835, 0.7499, 0.8086, 0.8593, 0.9023, 0.9375, 0.9648, 0.9844, 0.9961, 1 );
--power1-in-out: linear( 0, 0.0027, 0.0106 7.29%, 0.0425, 0.0957, 0.1701 29.16%, 0.2477, 0.3401 41.23%, 0.5982 55.18%, 0.7044 61.56%, 0.7987, 0.875 75%, 0.9297, 0.9687, 0.9922, 1 );
--power2-in: linear( 0, 0.0014 11.11%, 0.0071 19.24%, 0.0188 26.6%, 0.037 33.33%, 0.0634 39.87%, 0.0978 46.07%, 0.1407 52.02%, 0.1925 57.74%, 0.2559 63.49%, 0.3295 69.07%, 0.4135 74.5%, 0.5083 79.81%, 0.6141 85%, 0.7312 90.09%, 1 );
--power2-out: linear( 0, 0.2688 9.91%, 0.3859 15%, 0.4917 20.19%, 0.5865 25.5%, 0.6705 30.93%, 0.7441 36.51%, 0.8075 42.26%, 0.8593 47.98%, 0.9022 53.93%, 0.9366 60.13%, 0.963 66.67%, 0.9812 73.4%, 0.9929 80.76%, 0.9986 88.89%, 1 );
--power2-in-out: linear( 0, 0.0036 9.62%, 0.0185 16.66
@barthap
barthap / (iosCustomSchemes)app.json
Last active June 9, 2023 22:58
An Expo config plugin for including multiple custom URI schemes into Info.plist (CFBundleSchemes)
// Usage example
{
"expo": {
"scheme": "primary scheme", // supported out of the box, but only single scheme
...
"plugins": [
...
["./withIosCustomScheme", { customScheme: "extraScheme1" }],
["./withIosCustomScheme", { customScheme: "extraScheme2" }]
]
@straker
straker / README.md
Last active March 8, 2025 16:26
Basic Doodle Jump HTML and JavaScript Game

Basic Doodle Jump HTML and JavaScript Game

This is a basic implementation of the game Doodle Jump, but it's missing a few things intentionally and they're left as further exploration for the reader.

Further Exploration

  • Platforms Types
  • There are 4 different types of platforms: Normal, Broken, Moving, and Disappearing
@mrousavy
mrousavy / MEMOIZE.md
Last active October 20, 2025 02:24
Memoize!!! 💾 - a react (native) performance guide
In computing, memoization or memoisation
is an optimization technique used primarily
to speed up computer programs by storing
the results of expensive function calls and  
returning the cached result when the same
inputs occur again.                                         
                                                     — wikipedia
import { Gameplay } from "../Gameplay"
import { Submarine } from "./Submarine"
import Vector2Like = Phaser.Types.Math.Vector2Like
export class SubmarineTrail extends Phaser.GameObjects.Graphics {
private readonly colors: number[] = [0x0973B6, 0xF9CA06, 0xFF900B, 0xF2372E, 0xDA3328]
private readonly lineWidth: number = 18
private submarine: Submarine
private dy: number = 0
@souporserious
souporserious / getJSONFromFigmaFile.js
Created July 13, 2018 21:52
Generates JSON from Figma file
import request from 'request'
const api_endpoint = 'https://api.figma.com/v1'
const personal_access_token = 'FIGMA_ACCESS_TOKEN_HERE' // https://www.figma.com/developers/docs#auth-dev-token
function downloadSvgFromAWS(url) {
return new Promise((resolve, reject) => {
request.get(
url,
{
@nijicha
nijicha / install_nodejs_and_yarn_homebrew.md
Last active July 25, 2025 09:02
Install NVM, Node.js, Yarn via Homebrew
@CodingDoug
CodingDoug / README.md
Last active August 8, 2025 20:09
Copying data from Firebase Realtime Database to a Google Sheet in real time via Cloud Functions