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
--------------PostgreSQL | |
sudo apt-get install postgresql-9.1 | |
sudo apt-get install postgresql-server-dev-9.1 | |
sudo -u postgres createuser candidosg | |
--------------Node | |
sudo add-apt-repository ppa:chris-lea/node.js |
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
chmod 400 mirafloris.pem | |
-Quando criar a instância EC2 escolha o Group Security "quick-start-1" | |
-Verifique se seu servidor permite o acesso pela porta 22 para conexões SSH. | |
ssh -i ~/.ec2/mirafloris.pem ubuntu@54.232.212.142 | |
*Se apresentar este erro: | |
Failed to add the host to the list of known hosts (/home/candidosg/.ssh/known_hosts). |
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
-----> Migrating database | |
$ RAILS_ENV="production" bundle exec rake db:migrate | |
rake aborted! | |
undefined method `fetch' for false:FalseClass | |
/var/www/mirafloris/tmp/build-136935383314531/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_specification.rb:35:in `resolve_string_connection' | |
/var/www/mirafloris/tmp/build-136935383314531/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_specification.rb:25:in `spec' | |
! ERROR: Deploy failed. /var/www/mirafloris/tmp/build-136935383314531/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.12/lib/active_record/connection_adapters/abstract/connection_specification.rb:130:in `establish_connection' | |
/var/www/mirafloris/tmp/build-136935383314531/vendor/bundle/ruby/2.0.0/gems/activerecord-3.2.12/lib/active_record/railtie.rb:82:in `block (2 levels) in <class:Railtie>' |
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
/*global module:false*/ | |
module.exports = function(grunt) { | |
// Project configuration. | |
grunt.initConfig({ | |
// Metadata. | |
pkg: grunt.file.readJSON('package.json'), | |
banner: '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' + | |
'<%= grunt.template.today("yyyy-mm-dd") %>\n' + | |
'<%= pkg.homepage ? "* " + pkg.homepage + "\\n" : "" %>' + |
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 isPrime(n) { | |
if (n%1 || n<2) return false; | |
if (n%2==0) return (n==2); | |
var m=Math.sqrt(n); | |
for (var i=3;i<=m;i+=2) { | |
if (n%i==0) return false; | |
} | |
return true; | |
} |
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
/*global module:false*/ | |
module.exports = function(grunt) { | |
// load all grunt tasks | |
require('matchdep').filterDev('grunt-*').forEach(grunt.loadNpmTasks); | |
// Project configuration. | |
grunt.initConfig({ | |
// Metadata. | |
pkg: grunt.file.readJSON('package.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
define(['text!./template.html'], function(tpl) { | |
var template = _.template(tpl); | |
return { | |
initialize: function() { | |
this.render(); | |
this.attachEvents(); | |
this.sandbox.on('product.start', this.render, this); | |
this.sandbox.on('product.changePrice',this.changePrice, this); | |
this.sandbox.on('product.calculate',this.calculate, this); |
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
<div class="product"> | |
<div class="small-1 columns"> | |
<a href="#" class="button minus" title="Remover"> | |
<span class="icon-minus"></span> | |
</a> | |
</div> | |
<div class="small-10 columns"> | |
<div class="small-6 columns"> | |
<dl class="tabs" data-tab> | |
<dd class="active"><a href="#panel2-1">GLP</a></dd> |
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
.input{ | |
width:100px; | |
padding:5px; | |
margin-left:10px; | |
} | |
/* | |
* Como você esta em outro contexto/página de sua aplicação é interessante que essa modificação ocorra somente naquele lugar, assim | |
* mantém os atributos padrão para todos os outros inputs; | |
*/ |
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
<form class="outra-pagina"> | |
<input id="example" name="example" title=""></input> | |
</form> | |
<style> | |
.outra-pagina input{ | |
margin-left:0; | |
} |