Skip to content

Instantly share code, notes, and snippets.

View tgmarinho's full-sized avatar
💻
read my blog: tgmarinhopro.com

Thiago Marinho tgmarinho

💻
read my blog: tgmarinhopro.com
View GitHub Profile
@tgmarinho
tgmarinho / hasLetter.js
Last active July 6, 2018 04:36
maneiras de procurar uma letra em uma palavra ou frase.
const hasLetter = (str, letter) => str.indexOf(letter.toLowerCase()) > -1
const hasLetter2 = (str, letter) => str.includes(letter.toLowerCase())
// "thiago marinho".includes('m')
// "thiago marinho".indexOf('m') > -1
@tgmarinho
tgmarinho / scroll.css
Last active July 12, 2018 20:14
display none to the scrollbar
::-webkit-scrollbar {
display: none;
}
/*
<div style={{ overflow: 'scroll', border: '0px', maxHeight: '100vh' }}>
{children}
</div>
*/
@tgmarinho
tgmarinho / head.html
Created July 20, 2018 00:36
Most better HEAD SEO like a globo.com
<!DOCTYPE html>
<!--[if IE 9]><html class="ie9" lang="pt-br"><![endif]-->
<html lang="en">
<head>
<meta charset="utf-8">
<!-- Global site tag (gtag.js) - Google Analytics -->
#change keyboard to pt_br
#add list download updates
sudo gedit /etc/apt/sources.list
deb [by-hash=force] http://linuxdeepin.c3sl.ufpr.br/deepin/ panda main contrib non-free
sudo apt update -y
sudo apt dist-upgrade -y
@tgmarinho
tgmarinho / import.js
Last active September 6, 2018 18:36
import mongo
// quando o arquivo foi exportado como json
// $ mongoimport -h localhost:3001 -d meteor -c members members_new.json
// se o arquivo estiver em outro formato mas como json basta:
// mongoimport -h localhost:3001 -d meteor -c members --jsonArray file.json
@tgmarinho
tgmarinho / thof.js
Last active September 25, 2018 01:04
Training High Order Functions
// Training HOF => High Order Functions
const fnName = () => prompt('tell me your name')
const fnMiddle = () => prompt('tell me your middle name')
const fnLastName = () => prompt('tell me your lastname')
// Debuging
const fnName = () => prompt('Tell me your name.') 
const fnMiddle = () => prompt('Tell me your middle name.') 
const fnLastName = () => prompt('Tell me your last name.')
const withNameComplete = (...funcs) => funcs.map(func => func()).join(' ')
// example declare 3 funcs and I use it passing to withNameComplete
const fnName = () => prompt('Tell me your name')
const fnMiddle = () => prompt('Tell me your middle name')
const fnLastName = () => prompt('Tell me your lastname')
const withNameComplete = (…funcs) => console.log(funcs);
withNameComplete(fnName, fnMiddle, fnLastName)
const fnName = () => prompt('tell me your name')
const fnMiddle = () => prompt('tell me your middle name')
const fnLastName = () => prompt('tell me your lastname')
// using Map
const withNameComplete = (...funcs) => funcs.map(func => func()).join(' ')
console.log(withNameComplete(fnName, fnMiddle, fnLastName))