Skip to content

Instantly share code, notes, and snippets.

View jmquilario's full-sized avatar

jmquilario jmquilario

  • United Kingdom
  • 10:29 (UTC -12:00)
View GitHub Profile
@jmquilario
jmquilario / typescript-crash.ts
Created August 28, 2022 10:43 — forked from bradtraversy/typescript-crash.ts
Basic intro to TypeScript (From YouTube Crash Course)
// Basic Types
let id: number = 5
let company: string = 'Traversy Media'
let isPublished: boolean = true
let x: any = 'Hello'
let ids: number[] = [1, 2, 3, 4, 5]
let arr: any[] = [1, true, 'Hello']
// Tuple
@jmquilario
jmquilario / useRef.js
Last active August 20, 2023 20:56
useRef() Cheat Sheet
/*
NOTE:
There are 2 rules to remember about reference:
1. The value of the reference is persisted (remains unchanged) between component re-renderings;
2. Updating a reference doesn't trigger a component re-rendering.
2 main differences between reference and state:
1. Updating a reference doesn't trigger re-rendering, while updating the state makes the component re-render;
2. The reference update is synchronous while the state update is asynchronous.
@jmquilario
jmquilario / GraphQl.js
Created August 22, 2023 16:42
GraphQL Cheat Sheet
# GraphQL Cheat Sheet (with Pagination)
# Defining types
type User {
id: ID!
username: String!
posts: [Post!]!
}
type Post {
@jmquilario
jmquilario / setup_rn_sb.sh
Created November 26, 2023 11:14 — forked from dannyhw/setup_rn_sb.sh
Setup a new project to test the 6.0 alpha of react native storybook
#!/bin/bash
npx react-native init RnSBSixAlpha --template react-native-template-typescript;
cd RnSBSixAlpha;
yarn add @storybook/react-native@next \
@react-native-async-storage/async-storage \
@storybook/addon-ondevice-actions@next \
@storybook/addon-ondevice-controls@next \
@storybook/addon-ondevice-backgrounds@next \
@storybook/addon-ondevice-notes@next \