Skip to content

Instantly share code, notes, and snippets.

View candidosales's full-sized avatar
🏠
Focusing

Candido Sales Gomes candidosales

🏠
Focusing
View GitHub Profile
@candidosales
candidosales / canvas-install
Created May 21, 2013 23:51
Instalação do Canvas no ubuntu
--------------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
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).
-----> 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>'
@candidosales
candidosales / Gruntfile.js
Created June 14, 2013 03:45
Tutorial de grunt.js
/*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" : "" %>' +
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;
}
@candidosales
candidosales / Gruntfile.js
Last active December 19, 2015 08:59
Cria uma pasta dist, onde conterá todos os arquivos essenciais para produção. 1. Limpar dist; 2. Compila LESS; 3.1 Ler o index.html onde encontrar a posição e ordem dos CSS e JS, já configurando-os para concatenar e minificar; 4. Comprimir imagens e jogar na pasta dist; 5. Concatenar css, js; 6. Minificar css concatenado e jogar na pasta dist; 7…
/*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'),
@candidosales
candidosales / main.js
Last active January 2, 2016 01:49
aura_components/product/main.js
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);
@candidosales
candidosales / template.html
Created January 3, 2014 04:37
aura_components/product/template.html
<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>
@candidosales
candidosales / example.css
Last active August 29, 2015 14:01
Exemplo
.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;
*/
<form class="outra-pagina">
<input id="example" name="example" title=""></input>
</form>
<style>
.outra-pagina input{
margin-left:0;
}