Skip to content

Instantly share code, notes, and snippets.

View indiorlei's full-sized avatar

Indiorlei de Oliveira indiorlei

View GitHub Profile
{
"singleQuote": true
}
// to use call: const { isMobile } = useDeviceDetect();
import { useEffect, useState } from 'react';
export default function useDeviceDetect() {
const [isMobile, setMobile] = useState(false);
useEffect(() => {
const userAgent = typeof window.navigator === 'undefined' ? '' : navigator.userAgent;
const mobile = Boolean(userAgent.match(/Android|BlackBerry|iPhone|iPad|iPod|Opera Mini|IEMobile|WPDesktop/i));
// <input type="text" onkeypress="return somenteNumeros(event)">
function somenteNumeros(e) {
var charCode = e.charCode ? e.charCode : e.keyCode;
// charCode 8 = backspace
// charCode 9 = tab
if (charCode != 8 && charCode != 9) {
// charCode 48 equivale a 0
// charCode 57 equivale a 9
if (charCode < 48 || charCode > 57) {
return false;
@indiorlei
indiorlei / fade.js
Created May 15, 2020 17:27 — forked from alirezas/fade.js
fadeIn & fadeOut in vanilla js
function fadeOut(el){
el.style.opacity = 1;
(function fade() {
if ((el.style.opacity -= .1) < 0) {
el.style.display = "none";
} else {
requestAnimationFrame(fade);
}
})();
# Instalando Docker
https://docs.docker.com/install/linux/docker-ce/ubuntu/
Desinstalar versoes antigas
$ sudo apt-get remove docker docker-engine docker.io containerd runc
Atualize o pacote apt:
@indiorlei
indiorlei / .hyper.js
Last active June 2, 2021 11:27
arquivo de configuração do .hyper.js para windows
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
module.exports = {
config: {
// choose either `'stable'` for receiving highly polished,
// or `'canary'` for less polished but more frequent updates
updateChannel: 'stable',
@indiorlei
indiorlei / deploy-react-native.md
Last active May 1, 2024 16:09
Deploy App React Native

Deploy Aplicativo React Native na App Store e no Google Play: guia passo a passo

Antes de iniciar, verifique se você possui a conta do desenvolvedor para Android e iOS.

Reunir as informações necessárias para a Apps Store e o Google Play

Aqui estão as principais informações necessárias para implantar o aplicativo React Native.

  • Nome do aplicativo
@indiorlei
indiorlei / gist:1f873cf33fafe5c8e7913657382bc16d
Created November 13, 2019 12:54 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@indiorlei
indiorlei / .htaccess
Created April 26, 2019 03:01 — forked from gaelbillon/.htaccess
custom htaccess for speed, cache, gzip, ETags, etc
### ENVIRONMENT VARIABLES ###
SetEnv PHP_VER 5
SetEnv REGISTER_GLOBALS 0
### MAIN DEFAULTS ###
Options All -Indexes
DirectoryIndex index.html index.htm index.php
AddDefaultCharset UTF-8
### MIME TYPES ###
@indiorlei
indiorlei / gulpfile.js
Last active May 15, 2019 11:56
gulp + sass
var gulp = require('gulp');
var browserSync = require('browser-sync').create();
var sass = require('gulp-sass');
var prefix = require('gulp-autoprefixer');
var concat = require('gulp-concat');
var rename = require('gulp-rename');
var uglify = require('gulp-uglify');