Skip to content

Instantly share code, notes, and snippets.

View arnoldc's full-sized avatar
🏠
Working from home

Arnold Camas arnoldc

🏠
Working from home
  • Philippines
  • 21:43 (UTC -12:00)
View GitHub Profile
@arnoldc
arnoldc / foo.txt
Last active June 26, 2025 05:45
[Android] Running Emulator with certain DNS server
# list all avds
emulator -list-avds
emulator -avd Pixel_6_API_35
# Settings DNS server for emulator
emulator -avd Pixel_5_API_31 -dns-server 8.8.8.8
# Lock and Unlock
SLEEP = adb shell input keyevent 223
@arnoldc
arnoldc / foo.txt
Created November 6, 2023 01:49
[Workflow] ip
curl ifconfig.me
@arnoldc
arnoldc / foo.txt
Last active March 11, 2024 16:34
[node] node tips
USING NVM
nvm install <version)
- e.g nvm install 16
nvm list
- list all node versions
nvm use <verison>
@arnoldc
arnoldc / foo.txt
Last active October 5, 2023 19:09
[npm] npm tips
npm ls -all
- to see all the dependencies of the project
npm ls <package-name>
- to see the dependencies of a specific package
npx depcheck
- to see which dependencies are not used in the project
@arnoldc
arnoldc / foo.tsx
Last active August 8, 2023 14:01
[React] useCallback
// useCallback and useMemo are used to memoize functions and values respectively.
const onClick = useCallback(() => {
}, []);
<div onClick={onClick} />
@arnoldc
arnoldc / foo.tsx
Last active August 8, 2023 14:22
[React] useMemo memo
// memo in react is just render if props have changed, its not the traditional memoization
// use only when computation is expensive
// ************** Good ****************
const value = useMemo(() => numbers.reduce((a, b) => a + b, 0), [numbers]);
// ^ this is ok , because we are using useMemo to calculate a value based on an array of numbers
@arnoldc
arnoldc / foo.tsx
Last active February 10, 2024 14:05
[React] React with Typescript (Tips/Tricks)
/*
* ──────────── Table of contents ────────────
*
* @1 - Get Props of element
* @2 - Get Props of component
* @3 - Strong typing of props
* @4 - Props for a generic component
* ──────────── Table of contents ────────────
*/
@arnoldc
arnoldc / foo.txt
Last active July 31, 2023 16:20
[Work] Template for Gist
// Javascrip/Typescript note
/*
* ──────────── Table of contents ────────────
*
* @1.0 - Sample1
* @2.0 - Sample2
* @3.0 - Sample3
* @4.0 - Sample4
@arnoldc
arnoldc / foo.tsx
Last active August 1, 2023 14:25
[React] Noob mistakes
/*
*
* ──────────── Table of contents ────────────
*
* @1.0 - Invoking Component Functions Directly
* @2.0 - Rule of hooks
* @3.0 - Conditional Rendering
* ──────────── Table of contents ────────────
*/
@arnoldc
arnoldc / foo.txt
Created July 31, 2023 03:59
[React Native] Debug
iOS Simulator:
- Cmd ⌘ + D (or Device > Shake)
Android emulators:
- Cmd ⌘ + M (macOS) or Ctrl + M (Windows and Linux)
- adb shell input keyevent 82