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
  • 16:43 (UTC -12:00)
View GitHub Profile
@arnoldc
arnoldc / foo.txt
Created July 27, 2023 10:50
[Work] ngrok
./ngrok http https://0.0.0.0:443
@arnoldc
arnoldc / foo.txt
Last active July 12, 2023 09:43
[React Native] Storage
# react-native-async-storage
## Backup
- https://react-native-async-storage.github.io/async-storage/docs/advanced/backup/
- ^ but this thing needs ios capabilities???
@arnoldc
arnoldc / foo.txt
Last active July 18, 2023 11:11
[Ruby] installing ruby via rbenv
# Install rbenv
brew install rbenv
# Add in zshrc
open ~/.zshrc
eval "$(rbenv init - zsh)"
# List stable versions
rbenv install -l
@arnoldc
arnoldc / foo.txt
Last active June 1, 2023 03:07
[Work] Git checkout and clear all the pods
git checkout branch && && rm -rf node_modules && npm install --legacy-peer-deps && rm -rf ios/Pods && cd ios && pod install && cd .. && yarn start
@arnoldc
arnoldc / foo.txt
Created April 19, 2023 02:09
[Work] Issue with USB iPhone disconnecting and connecting
- quit xcode
- restart xcode
- reset location in iPhone
- sudo killall -STOP -c usbd
- sudo launchctl stop com.apple.usbmuxd
@arnoldc
arnoldc / foo.txt
Last active April 12, 2023 14:18
[React Native] Native Module
Basic Creation
1. Create new swift file + Add also the bridging header file
// example
@arnoldc
arnoldc / foo.tsx
Last active March 9, 2023 17:12
[React Native] Optimizations Tips
// 1. Synchronization of input text when typing too fast
/*
One of the solutions for the synchronization problem is to remove the
value prop from TextInput entirely.
*/
@arnoldc
arnoldc / foo.txt
Last active February 27, 2023 17:05
[React Native] Architecture Tips
// pattern 1 - component structure
index.tsx: The index file contains the business logic of the component such as data fetching,
as well as the connection to the global application state. It only renders the following .view component.
<component>.view.tsx: The view file contains the UI. It doesn’t hold its own state nor does it connect directly to the global application state. It only renders the props it gets from the index file.
<component>.styles.tsx: The styles file contains the React Native StyleSheet or the styled-components, depending on which approach you chose.
@arnoldc
arnoldc / foo.ts
Last active November 1, 2023 14:40
[Typescript] Useful snippet
// ****** Generics
// example 1 - a class
class Set<T> {
private items: T[];
constructor(initialItems: T[] = []) {
this.items = initialItems;
@arnoldc
arnoldc / foo.ts
Last active February 22, 2023 13:28
[Typescript] Design Patterns
/*
Table of Contents
- @builder Pattern
- @singleton Pattern
*/
// =================== @builder Pattern ===================
class PremiumWebsiteBuilder implements WebsiteBuilder {
constructor(private website: Website) {