Skip to content

Instantly share code, notes, and snippets.

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

Gerardo Ortega g3ortega

🏠
Working from home
View GitHub Profile
# frozen_string_literal: true
module Mexico
module Payrolls
class PerceptionBuilder
attr_reader :calculations
PERCEPTION_TYPES = %w[022 023 025 039 044].freeze
COMPENSATION_PAYMENT_SEPARATION = %w[022 023 025].freeze
RETIREMENT_PENSIONS_BENEFITS = %w[039 044].freeze
[ActionCable] Broadcasting to user_modal_gerardo-ortega: {:status=>"oauth_error", :provider=>"facebook", :errorMessage=>"Error: {\"message\"=>\"(#100) Tried accessing nonexisting field (tagged_places) on node type (User)\", \"type\"=>\"OAuthException\", \"code\"=>100, \"fbtrace_id\"=>\"APTHmAB-ZwVGldNB26KLO97\"}: \n{\"error\":{\"message\":\"(#100) Tried accessing nonexisting field (tagged_places) on node type (User)\",\"type\":\"OAuthException\",\"code\":100,\"fbtrace_id\":\"APTHmAB-ZwVGldNB26KLO97\"}}"}
I, [2019-08-14T12:40:37.627342 #29618] INFO -- : UserModalChannel transmitting {"status"=>"oauth_error", "provider"=>"facebook", "errorMessage"=>"Error: {\"message\"=>\"(#100) Tried accessing nonexisting field (tagged_places) on node type (User)\", \"type\"=>\"OAuthException\", \"code\"=>100, \"fbtrace_id\"=>\"APTHmAB-ZwVGldNB26KLO97\"}: \n{\"error\":{\"message\":\"(#100) T... (via streamed from user_modal_gerardo-ortega)
@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"
https://join.slack.com/t/rails-101/shared_invite/enQtMzE2ODAwMTI0MjU4LTdiNjJhNTlkZTUyZjQ2ZTFmZTcxZDJhNjViYjJlZTFjZmZhZTdkZDkzMGUyMWIyYjE0OGUwNGY2YTlhMGU0NjM
======= 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