/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
nano ~/.zshrc
PROMPT='%n~$'
export NVM_DIR="${HOME}/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm
export PATH=${PATH}:$HOME/Library/Android/sdk/platform-tools/
brew doctor
npx https://gist.github.com/chnirt/1445f38cb8df53c00fc15a84ef163cc2
if you've previously installed chnirt-build-app globally via npx https://gist.github.com/chnirt/1445f38cb8df53c00fc15a84ef163cc2, we recommend you uninstall the package using npm uninstall -g chnirt-build-app or yarn global remove chnirt-build-app to ensure that npx always uses the latest version. NOTE: remember to clear cache using npx clear-npx-cache
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 { useCallback, useEffect, useState } from 'react' | |
import { | |
collection, | |
query, | |
orderBy, | |
limit, | |
startAfter, | |
onSnapshot, | |
} from 'firebase/firestore' |
For Android
npm cache clean --force
cd android && ./gradlew clean
npm i
npm run android
For iOS
Desktop -> About this Mac -> Storage -> Manage -> Developer -> delete Project Build Data and Indexes
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
// There is a string s, which consists of lowercase letters from twenty-six alphabet letters "a" through "z". You are asked to find the second most frequent letter in this string. For example, if s = “xddxdca”, then the second most frequent letter in this string is“x”. | |
// Even if there is more than one letter that are most frequent, none of them should count toward picking the second most frequent letter. For example, if s = “jpcpjppcyycyy”, then the most frequent letters in this string are “p” and “y”, as there are four of each in the string. In this case, the second most frequent letter in this string will be “c”, as there are three "c"s in this string. | |
// If there is more than one second most frequent letter in the given string, then arrange them in alphabetical order. For example, if s = “brbabrrara”, then the second most frequent letters here are “b” and “a”. Arrange them in alphabetical order, and you get “ab”. | |
// In the case where there is no second most frequent letter in the given string s, you mu |
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
// There are strings that are made of brackets—[,], braces—{,}, and parentheses—(,). A string is regarded as a valid string of brackets when it meets the following conditions: | |
// In brackets, there can be brackets, braces, and parentheses. | |
// In braces, there can only be braces and parentheses. | |
// 2-1. "{[]()}" is invalid, because brackets are in braces. | |
// In parentheses, there can only be other parentheses. | |
// 3-1. "({()})" is invalid, because braces are in parentheses. | |
// All open brackets, braces, and parentheses must be closed by the corresponding number of brackets, braces, and parentheses. |
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
// You are trying to figure out how many binary numbers there are that have N digits and k 1s, and are multiples of 3. Binary numbers that have N digits also include ones that start with 0. | |
// Suppose that N = 3 and K = 2. Binary numbers with three digits in this case include the following: 000, 001, 010, 011, 100, 101, 110, and 111--8 binary numbers in total. Among these numbers, the ones that have two 1s are 011, 101, and 110. Among these three numbers, two--011 and 110--are multiples of 3. | |
// Suppose parameters N and K are given, where N represents the number of digits of the given binary number(s) and K the number of 1s in these binary numbers. Please write a function solution that returns the number of binary numbers that have N digits and k 1s and are multiples of 3 | |
// Constraints | |
// N is a natural number between 1 and 50. | |
// K is a natural number between 1 and N. | |
// Examples |
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 numeral from 'numeral'; | |
export const formatCurrency = (number, symbol = '$') => { | |
const formatScientificNotationNumber = Number(number).toFixed(8); // format for case number = 9.322320693172514e-12 | |
if (formatScientificNotationNumber.includes('e+')) { | |
var formatter = new Intl.NumberFormat('en-AU', { | |
style: 'currency', | |
currency: 'AUD', | |
minimumFractionDigits: 0, |
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
echo "Encrypt & Decrypt with PGP by Chnirt" | |
# install gpg | |
# https://gpgtools.org/ | |
# gpg --full-generate-key | |
choice="Encrypt Decrypt Exist" | |
select option in $choice | |
do | |
echo "$option" |
NewerOlder