View useToggleStorybook.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { config } from "@/app/config"; | |
import { createLogger } from "@/app/observability"; | |
import { useEffect } from "react"; | |
const { appEnv } = config; | |
const logger = createLogger("developer/storybook"); | |
export const useToggleStorybook = () => { | |
const [isStorybookEnabled, setIsStorybookEnabled] = useState(false) |
View .gitignore
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/out.mp4 |
View Text.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { TranslateOptions } from 'i18n-js/typings' | |
import {StyleProp, Text as RNText, TextProps as RNTextProps, TextStyle} from 'react-native' | |
import { TxKeyPath, useI18n } from '../hooks/useI18n' | |
import { ThemeProps, useThemeColor } from './Themed' | |
const presets = { | |
default: {fontSize: 17, lineHeight: 24, fontWeight: 'normal'} as StyleProp<TextStyle>, | |
primary: {fontSize: 17, lineHeight: 24, fontWeight: '600'} as StyleProp<TextStyle>, | |
secondary: {fontSize: 17, lineHeight: 24, fontWeight: 'normal'} as StyleProp<TextStyle>, | |
header: {fontSize: 27, lineHeight: 34, fontWeight: '600' } as StyleProp<TextStyle>, |
View cleanup_node_modules.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Cleanup node_modules | |
echo "Calculate disk space for node_modules in all directory" | |
find . -name "node_modules" -type d -prune -print | xargs du -chs | |
echo "Remove all node_modules directory" | |
find . -name 'node_modules' -type d -prune -print -exec rm -rf '{}' \; |
View const_keyword.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Contact { | |
// Constructor is marked 'const' so all fields must be final. | |
final String name; | |
final int age; | |
// const at class level have to go along with static keyword | |
static const alive = true; | |
// const constructor | |
const Contact(this.name, this.age); |
View final_keyword.dart
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Contact { | |
String name; | |
int age; | |
Contact(this.name, this.age); | |
@override | |
String toString() { | |
return "$name: $age"; | |
} |
View AudioCue.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.example; | |
import android.content.Context | |
import android.content.Context.AUDIO_SERVICE | |
import android.media.AudioAttributes | |
import android.media.AudioFocusRequest | |
import android.media.AudioManager | |
import android.os.Build | |
import android.os.Bundle | |
import android.speech.tts.TextToSpeech |
View react-native-reanimated-drag-sort_apple-music.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Expo SDK40 | |
// expo-blur: ~8.2.2 | |
// expo-haptics: ~8.4.0 | |
// react-native-gesture-handler: ~1.8.0 | |
// react-native-reanimated: ^2.0.0-rc.0 | |
// react-native-safe-area-context: 3.1.9 | |
import React, { useState } from 'react'; | |
import { | |
Image, |
View regex-vietnamese-phone-number-updated-2018.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Before Septemper 15 2018, Vietnam has phone number start with 09*, 01(2|6|8|9). | |
After that, the phone number can start with 03, 05, 07 or 08. | |
So this function provide a way to validate the input number is a Vietnamese phone number | |
*/ | |
function isVietnamesePhoneNumber(number) { | |
return /(03|05|07|08|09|01[2|6|8|9])+([0-9]{8})\b/.test(number); | |
} |
View VehicleMarker.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, {memo, useEffect, useState} from 'react'; | |
import {Animated, Platform, StyleSheet} from 'react-native'; | |
import {AnimatedRegion, Marker} from 'react-native-maps'; | |
import {Car} from '../../../../../Assets/Images'; | |
function VehicleMarker({ | |
data, | |
tripIndex, | |
initLatDelta, | |
initLongDelta, |
NewerOlder