Skip to content

Instantly share code, notes, and snippets.

View gouvermxt's full-sized avatar
:electron:

Marcio Gouvea Silva gouvermxt

:electron:
View GitHub Profile
@gouvermxt
gouvermxt / postgres-brew.md
Created June 4, 2019 15:26 — forked from ibraheem4/postgres-brew.md
Installing Postgres via Brew (OSX)

Installing Postgres via Brew

Pre-Reqs

Brew Package Manager

In your command-line run the following commands:

  1. brew doctor
  2. brew update
/* -------------------------------------------------------------------------------------- */
/* HEADER */
/* -------------------------------------------------------------------------------------- */
header {
background-color: #3C4B5B;
@gouvermxt
gouvermxt / base.css
Last active October 20, 2017 11:58
My basic css style
/* -------------------------------------------------------------------------------------- */
/* BASIC SETUP */
/* -------------------------------------------------------------------------------------- */
* {
/* default css reset */
padding: 0;
margin: 0;
box-sizing: border-box;
}
@gouvermxt
gouvermxt / queries.css
Last active October 20, 2017 11:59
Basic media queries for base.css
/* From big tablets to 1200px (widths smaller then the 1140px row) */
@media only screen and (max-width: 1200px) {
.row {
padding: 0 2%;
}
section {
padding-top: 2%;
}
}
@gouvermxt
gouvermxt / database.yml
Last active August 17, 2017 18:37
Rails database configuration file for use with my Vagrantfile and PostgreSQL
default: &default
adapter: postgresql
pool: 5
timeout: 5000
host: localhost
username: vagrant
password: vagrant
development:
<<: *default
@gouvermxt
gouvermxt / Vagrantfile
Created August 17, 2017 18:23
Vagrant file for Ruby environment
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "private_network", ip: "10.2.2.2"
config.vm.network :forwarded_port, guest: 3000, host: 3000
config.vm.network :forwarded_port, guest: 5432, host: 5432
======= Prolbem =================================================================================================================
I have installed : ruby-2.0.0,postgres-9.2 , now in rails app when I execute:
rake db:create , command I get:
PG::InvalidParameterValue: ERROR: new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
HINT: Use the same encoding as in the template database, or use template0 as template.
: CREATE DATABASE "my_db_name" ENCODING = 'unicode'.......
bin/rake:16:in `load'
@gouvermxt
gouvermxt / cloud9-postgresql-rails-howto.md
Created August 3, 2017 22:23 — forked from eliotsykes/cloud9-postgresql-rails-howto.md
How to setup PostgreSQL & Rails on Cloud9

How to setup PostgreSQL & Rails on Cloud9

At time of writing, Cloud9 has PostgreSQL pre-installed, so you won't need to install it yourself. However, its not running by default, so you will need to start it with this command in the terminal:

sudo service postgresql start

Change the PostgreSQL password to 'password' (or choose a different password):

sudo -u postgres psql
UPDATE pg_database SET datistemplate = FALSE WHERE datname = 'template1';
DROP DATABASE template1;
CREATE DATABASE template1 WITH TEMPLATE = template0 ENCODING = 'UNICODE';
UPDATE pg_database SET datistemplate = TRUE WHERE datname = 'template1';
\c template1
VACUUM FREEZE;
sudo /etc/init.d/postgresql restart
@gouvermxt
gouvermxt / Vagrantfile
Last active August 15, 2017 12:11
Setups an Ubuntu machine for Rails development.
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure(2) do |config|
config.vm.box = "ubuntu/trusty64"
config.vm.network "private_network", ip: "10.2.2.2"
config.vm.network :forwarded_port, guest: 3000, host: 3000
config.vm.network :forwarded_port, guest: 5432, host: 5432