<!DOCTYPE html>
<html>
<head>
<title>Centralizando DIV</title>
Problema: Ao instalar o Bower no Ubuntu ocorre o erro:
user@user-pc:~/Documents/projects/bower-test$ bower install angular
/usr/lib/node_modules/bower/lib/node_modules/configstore/index.js:54
throw err;
^
Error: EACCES: permission denied, open '/home/user/.config/configstore/bower-github.json'
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
var ajax = function(config) { | |
var xhr = new XMLHttpRequest(); | |
xhr.open(config.method, config.url, true); | |
xhr.setRequestHeader('Content-Type', 'application/json'); | |
xhr.onload = function (e) { | |
if (xhr.readyState === 4) { | |
config.callback({ | |
status: xhr.status, | |
response: xhr.responseText | |
}); |
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
'use strict'; | |
// Captura os parâmetros passados após o nome do arquivo | |
var name = process.argv.splice(2, process.argv.length -1); | |
name = wordUpper(name).join(' '); | |
console.log(name); | |
function wordUpper(arrWords) { |
Neste caso foi utilizado o Wamp como servidor local.
- Abra o arquivo c:\Windows\System32\drivers\etc\hosts com seu editor de textos.
- Adicione a seguinte linha no final do arquivo:
127.0.0.1 seu-projeto.app www.seu-projeto.app
- Abra o arquivo httpd.conf, que é o arquiov de configuração do Apache. Com o Wamp ele fica na pasta C:\wamp\bin\apache\apache2.4.18\conf\httpd.conf.
- Adicione as linhas a seguir no final do arquivo:
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
exports = typeof window === 'undefined' ? global : window; | |
exports.arraysAnswers = { | |
indexOf: function(arr, item) { | |
return arr.indexOf(item); | |
}, | |
sum: function(arr) { | |
return arr.reduce(function(previousValue, currentValue) { | |
return previousValue + currentValue; |
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
var s = 0; | |
var m = 0 | |
var t = window.setInterval(function() { | |
console.log((parseInt(s).toFixed(0)) + ':' + m); | |
s += 0.1; | |
m = m === 9 ? 0 : m + 1; | |
}, 100); | |
window.setTimeout(function() { |
OlderNewer