Skip to content

Instantly share code, notes, and snippets.

View wesleyfeitosa's full-sized avatar
🎯
Focusing

Wesley Feitosa wesleyfeitosa

🎯
Focusing
View GitHub Profile
@yovany-lg
yovany-lg / expo-typescript-eslint-prettier.md
Last active April 12, 2024 17:08
Setting up React Navite: Expo + Typescript + Eslint (Airbnb) + Prettier

Steps to get started with Expo, Typescript, ESLint and Prettier

The first step is to use the Expo CLI to initialize the project. If you don't have the latest version of the Expo CLI tool, (or you don't have it installed) run npm install -g expo-cli.

Now run the following commands in the same order:

  • expo init my-app -t expo-template-blank-typescript
  • npx install-peerdeps --dev eslint-config-airbnb
  • npm i --save-dev @typescript-eslint/parser @typescript-eslint/eslint-plugin
  • npm i --save-dev prettier eslint-config-prettier eslint-plugin-prettier

Create or edit the file .eslintrc.json with the following content:

@georgealan
georgealan / react-native-android-studio-no-wsl2.md
Last active March 18, 2024 14:46
React Native no Emulador Android Studio com WSL2

REACT-NATIVE PROJECTS RUN IN WSL2 UBUNTU 22.04 WITH BACKEND API

📆 Article written day: 9/03/2020 📆 Article updated day: 6/18/2022

My System Specs:

  • Microsoft Windows 10 Enterprise Version 21H2 (OS Build 19044.1766)
  • WSL2 - Ubuntu 22.04 LTS
  • Android Studio Version: Chipmunk 2021.2.1 Patch 1
@bergmannjg
bergmannjg / rearct-native-app-in-wsl2.md
Last active May 3, 2024 12:19
Building a react native app in WSL2
@leodutra
leodutra / -setup-windows-wsl-devenv.md
Last active April 5, 2024 23:44
Install and Setup Windows Subsystem 2 for Linux, Hyper, ZSH + Oh My Zsh + Powerlevel9k + plugins, FNM + VSCode (+ext) and Nerd Font

Setup Windows Subsystem 2 for Linux

Windows Subsystem 2 for Linux, Hyper, ZSH + Oh My Zsh + Powerlevel9k + plugins, FNM + VSCode (+ext) and Nerd Font

To setup native Linux, see this gist

Preview

Requirements

@diego3g
diego3g / settings.json
Last active May 3, 2024 14:09
VSCode Settings (Updated)
{
"workbench.startupEditor": "newUntitledFile",
"editor.fontSize": 14,
"editor.lineHeight": 1.8,
"javascript.suggest.autoImports": true,
"javascript.updateImportsOnFileMove.enabled": "always",
"editor.rulers": [80, 120],
"extensions.ignoreRecommendations": true,
"typescript.tsserver.log": "off",
"files.associations": {
@mrk-han
mrk-han / emulator-install-using-avdmanager.md
Last active May 1, 2024 21:12
Installing and creating Emulators with AVDMANAGER (For Continuous Integration Server or Local Use)

Install and Create Emulators using AVDMANAGER and SDKMANAGER

TL;DR

For an emulator that mimics a Pixel 5 Device with Google APIs and ARM architecture (for an M1/M2 Macbook):

  1. List All System Images Available for Download: sdkmanager --list | grep system-images

  2. Download Image: sdkmanager --install "system-images;android-30;google_atd;arm64-v8a"

@npearce
npearce / install-docker.md
Last active April 19, 2024 12:35
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@jjvillavicencio
jjvillavicencio / setup.sh
Last active May 5, 2024 12:53
Install Android SDK on Windows Bash (WSL)
cd /home/<user>/
sudo apt-get install unzip
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip sdk-tools-linux-4333796.zip -d Android
rm sdk-tools-linux-4333796.zip
sudo apt-get install -y lib32z1 openjdk-8-jdk
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$PATH:$JAVA_HOME/bin
printf "\n\nexport JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64\nexport PATH=\$PATH:\$JAVA_HOME/bin" >> ~/.bashrc
cd Android/tools/bin
@javilobo8
javilobo8 / download-file.js
Last active April 9, 2024 12:01
Download files with AJAX (axios)
axios({
url: 'http://localhost:5000/static/example.pdf',
method: 'GET',
responseType: 'blob', // important
}).then((response) => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', 'file.pdf');
document.body.appendChild(link);
@yajra
yajra / axios-401-response-interceptor.js
Last active September 20, 2023 06:24
Axios 401 response interceptor.
// Add a 401 response interceptor
window.axios.interceptors.response.use(function (response) {
return response;
}, function (error) {
if (401 === error.response.status) {
swal({
title: "Session Expired",
text: "Your session has expired. Would you like to be redirected to the login page?",
type: "warning",
showCancelButton: true,