Skip to content

Instantly share code, notes, and snippets.

View FelipeGangrel's full-sized avatar

Felipe Pires de Oliveira FelipeGangrel

View GitHub Profile
@FelipeGangrel
FelipeGangrel / rn-with-wsl-wsa.md
Created August 28, 2022 12:38 — forked from xquangdang/rn-with-wsl-wsa.md
Develop React Native app with WSL and WSA

Develop React Native app with WSL and WSA

Requirement

  • Windows Subsystem for Linux 2 (WSL2)
  • Windows Subsystem for Android (WSA)
  • NodeJS install inside WSL2

Steps

WSA

function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit, working tree clean" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/(\1$(parse_git_dirty))/"
}
export PS1='\[\e[\033[01;34m\]\u@\h \[\e[38;5;211m\]\W\[\e[\033[38;5;48m\] $(parse_git_branch)\[\e[\033[00m\]\$ '
@FelipeGangrel
FelipeGangrel / PortProxyWithNetshOnPowerShell.md
Last active September 30, 2021 17:04
Port proxy with netsh on PowerShell
netsh interface portproxy add v4tov4 listenport=3333 listenaddress=0.0.0.0 connectport=3333 connectaddress=<YOUR_IP>
@FelipeGangrel
FelipeGangrel / docker-compose.yml
Created July 12, 2021 20:10
Useful Docker Compose Config
# For mysql use root/root as user/password
# For ftp use admin/123 as user/password
version: "3.3"
services:
db:
image: mysql
container_name: mysql
command: --default-authentication-plugin=mysql_native_password
restart: always
@FelipeGangrel
FelipeGangrel / react-native-android-studio-no-wsl2.md
Last active July 4, 2021 18:29 — forked from georgealan/react-native-android-studio-no-wsl2.md
React Native no Emulador Android Studio com WSL2

PROJETOS REACT-NATIVE RODANDO NO WSL2 UBUNTU 20.04 COM API BACKEND

📆 Artigo escrito dia: 03/09/2020 📆 Artigo atualizado dia: 10/10/2020

Minhas especificações: Microsoft Windows 10 Enterprise Versão 2004 (Compilação 19041.450). WSL2 - Ubuntu 20.04.

INDÍCE

@FelipeGangrel
FelipeGangrel / getExcerpt
Last active February 10, 2021 18:25
getHtmlExcerpt.js
export function getExcerpt(htmlString, length) {
const span = document.createElement("span");
span.innerHTML = htmlString;
const outputString = span.textContent || span.innerText;
if (outputString.length > length) {
// obtendo os *length* primeiros caracteres sem quebrar palavras
// usando flag s para tratar a string como single line
const exp = new RegExp(`^(.{${length}}[^\\s]*).*`, "s");
@FelipeGangrel
FelipeGangrel / ext.txt
Created May 31, 2020 00:36 — forked from chronon/ext.txt
List of docker-php-ext-install extension names
Possible values for ext-name:
bcmath
bz2
calendar
ctype
curl
dba
dom
enchant
alias dev='cd d:/Felipe/Dev'
alias dev-react='dev && cd React'
alias dev-react-native='dev && cd ReactNative'
alias dev-vue='dev && cd Vue'
alias dev-flutter='dev && cd Flutter'
alias dev-adb='cd ~/AppData/Local/Android/Sdk/platform-tools/'
alias react-native-menu='dev-adb && ./adb shell input keyevent 82'
@FelipeGangrel
FelipeGangrel / AlterTables.sql
Created February 20, 2019 13:45
SIVIS | TICKET4YOU | SQLServer
/** Adicionando campo obrigatorio_credenciamento à sf_eventos */
ALTER TABLE [dbo].[sf_eventos] ADD obrigatorio_credenciamento TINYINT NOT NULL DEFAULT 0;
GO
EXEC sys.sp_addextendedproperty
@name=N'MS_Description', @value=N'0 => não permite credenciamento, 1 => credenciamento opcional, 2 => credenciamento obrigatório',
@level0type=N'SCHEMA', @level0name=N'dbo',
@level1type=N'TABLE', @level1name=N'sf_eventos',
@level2type=N'COLUMN', @level2name=N'obrigatorio_credenciamento'
GO
@FelipeGangrel
FelipeGangrel / scripts.sql
Last active March 1, 2019 18:39
SIVIS | TICKET4YOU | SQLServer
/** Limpar eventos de teste */
DECLARE @eventoId int = 8;
DELETE FROM sf_eventos_ambientes WHERE id_evento >= @eventoId;
DELETE FROM sf_eventos_configuracao WHERE id_evento >= @eventoId;
DELETE FROM sf_ingresso WHERE id_evento >= @eventoId;
DELETE FROM sf_eventos WHERE id >= @eventoId;
SELECT * FROM sf_eventos;
SELECT * FROM sf_eventos_ambientes;