Skip to content

Instantly share code, notes, and snippets.

View g3ortega's full-sized avatar
🏠
Working from home

Gerardo Ortega g3ortega

🏠
Working from home
  • Costa Rica
  • 10:47 (UTC -06:00)
View GitHub Profile
@g3ortega
g3ortega / mysql2-mojave.md
Created July 15, 2019 15:51 — forked from fernandoaleman/mysql2-mojave.md
Install mysql2 on MacOS Mojave

Problem

Installing mysql2 gem errors on MacOS Mojave.

Solution

Make sure openssl is installed on Mac via Homebrew.

brew install openssl
@g3ortega
g3ortega / gist:ec4b62deea1df707f8d9e0ae79bff63b
Last active March 17, 2019 05:01
Rails Testing with RSpec
> Cheatsheet for RSpec, to print <
https://devhints.io/rspec-rails
> Useful Gems for testing <
gem 'rspec-rails'
gem 'faker'
gem "shoulda-matchers", require: false
gem 'guard-rspec', require: false
### gem "email_spec"
gem "factory_bot_rails"
======= 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'
@g3ortega
g3ortega / install_postgresql9.4_postgis2.1_ubuntu.md
Created June 13, 2017 17:50 — forked from ansell/install_postgresql9.4_postgis2.1_ubuntu.md
Installing PostgreSQL 9.4 and PostGIS on Ubuntu 14.04

Remove old PostGIS Installation

The first step is to remove older version of PostGIS if any.

sudo apt-get purge postgis

Setup repository

wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | sudo apt-key add -
sudo sh -c 'echo "deb http://apt.postgresql.org/pub/repos/apt/ trusty-pgdg main" >> /etc/apt/sources.list.d/postgresql.list'
@g3ortega
g3ortega / up-and-running-with-edeliver-on-do.md
Created September 16, 2016 03:22 — forked from davoclavo/up-and-running-with-edeliver-on-do.md
Getting Elixir / Phoenix running on Digital Ocean with edeliver

Build Server

  • Go to Digital Ocean
  • Create new ubuntu droplet

Setup Server

@[Link("opencv")]
lib LibCv
fun cvPoint(x : Int32, y : Int32)
end
# LibCv.cvPoint(1,2)
@g3ortega
g3ortega / ruby_google_analytics_server_to_server.md
Created April 4, 2016 01:40 — forked from joost/ruby_google_analytics_server_to_server.md
Google Analytics API (server-to-server) using Ruby
@g3ortega
g3ortega / index.html
Created December 10, 2015 21:33
React Practica
<head>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.3/react.js">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.3/JSXTransformer.js">
</script>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" integrity="sha512-dTfge/zgoMYpP7QbHy4gWMEGsbsdZeCXz7irItjcC3sPUFtf0kuFbDz/ixG7ArTxmDjLXDmezHubeNikyKGVyQ==" crossorigin="anonymous">
</head>
<body>
</body>
@g3ortega
g3ortega / conf.sh
Created September 8, 2015 23:44
MySQL para Rails en Ubuntu
# En el proceso de instalación se pedirá un password, si es en producción recuerda escoger un password seguro. En un entorno de desarrollo se puede ser más fléxible.
$ sudo apt-get install mysql-server
$ sudo apt-get install mysql-client
# Para verificar si se instaló correctamente
$ sudo netstat -tap | grep mysql
# Para rails asegurate de instalar la siguiente dependencia
/* Based on
* - EGM Mathematical Finance class by Enrique Garcia M. <[email protected]>
* - A Guide to the PMT, FV, IPMT and PPMT Functions by Kevin (aka MWVisa1)
*/
var ExcelFormulas = {
PVIF: function(rate, nper) {
return Math.pow(1 + rate, nper);
},