This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get update | |
apt-get upgrade | |
# CA certificates | |
apt-get install apt-transport-https ca-certificates dirmngr -y | |
# public key | |
apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D | |
# repo |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ sudo npm install -g cordova | |
$ cordova create <folder> | |
$ cordova platform add browser | |
$ cordova plugin add cordova-plugin-browsersync | |
$ cordova run -- --live-reload | |
# update platforms/android/project-properties | |
target=android-17 | |
# create ~/.bash_profile |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// install | |
sudo npm install -g webdriver-manager | |
// update webdriver | |
sudo webdriver-manager update | |
// run selenium | |
webdriver-manager start --standalone | |
// copy drivers to PATH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from Ideal.js (https://github.com/webarthur/ideal.js/blob/master/src/Date.isValid.js) | |
Date.isValid = function (s) { | |
var l = s.length | |
var j = 0 | |
var dt = { 0: '', 1:'', 2:'' } | |
// dias de cada mês | |
var n = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] | |
// divide a data para o objeto "dt" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# init.coffee | |
atom.commands.add 'atom-text-editor', 'webarthur:comment', -> | |
return unless editor = atom.workspace.getActiveTextEditor() | |
selection = editor.getLastSelection() | |
selection.insertText('// Arthur Araújo ' + new Date().toLocaleDateString() + ' ') | |
# keymap.cson | |
'atom-workspace atom-text-editor:not([mini])': | |
'ctrl-e': 'editor:toggle-line-comments' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from Ideal.js (https://github.com/webarthur/ideal.js) | |
window.location.getQueryParams = function(query) { | |
// se o parâmetro query não foi definido pega o parâmetro da URL | |
if (!query) { | |
query = window.location.search.substring(1) | |
} | |
var l = query.length | |
var q = {} // objeto a ser retornado |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// from Ideal.js (https://github.com/webarthur/ideal.js) | |
window.location.getQueryParam = function(name, query) { | |
// se o parâmetro query não foi definido pega o parâmetro da URL | |
if (!query) { | |
query = window.location.search | |
} | |
var l = query.length | |
var n = '' // nome |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# A partir da versão 12.04 - remover todos os kernels de versões antigas sem uso | |
# Elimina arquivos antigos (incluindo kernels). | |
sudo apt-get autoclean | |
# Elimina tudo o que foi baixado e guardado no diretório de cache do apt | |
sudo apt-get clean | |
# Procura por pacotes, dependências e bibliotecas sem uso e remove caso necessário | |
sudo apt-get autoremove |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function is_cpf (c) { | |
if((c = c.replace(/[^\d]/g,"")).length != 11) | |
return false; | |
if (c == "00000000000") | |
return false; | |
var r; | |
var s = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cd ~ | |
curl -sL https://deb.nodesource.com/setup_6.x -o nodesource_setup.sh | |
sudo bash nodesource_setup.sh | |
sudo apt-get install nodejs | |
// opicional | |
sudo apt-get install build-essential | |
// fonte: https://www.digitalocean.com/community/tutorials/como-instalar-o-node-js-no-ubuntu-16-04-pt |