Skip to content

Instantly share code, notes, and snippets.

View mohammad-hassani's full-sized avatar
🤝
i believe in the land of desires

mohammad hassani mohammad-hassani

🤝
i believe in the land of desires
View GitHub Profile

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@mohammad-hassani
mohammad-hassani / ReactNativeFetch.tsx
Last active April 12, 2022 10:13
This is an example of Fetch function in react-native that contains lots of parameters like: navigation, URL, method, urlParams, headers, base-URL, auth, etraURL, body and connection check
import NetInfo from '@react-native-community/netinfo';
import {NavigationProp, ParamListBase} from '@react-navigation/native';
interface FetchProps {
navigation: NavigationProp<ParamListBase>;
base?: string;
url: string;
method?: 'POST' | 'GET' | 'PUT' | 'PATCH' | 'UPDATE' | 'DELETE';
body?: any;
headers?: {
# Add in ~/.bashrc or ~/.bash_profile
function parse_git_branch () {
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
RED="\[\033[01;31m\]"
YELLOW="\[\033[01;33m\]"
GREEN="\[\033[01;32m\]"
BLUE="\[\033[01;34m\]"
NO_COLOR="\[\033[00m\]"