Skip to content

Instantly share code, notes, and snippets.

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

Oscar Rodríguez mldoscar

🏠
Working from home
View GitHub Profile
@mldoscar
mldoscar / es-NI.yml
Created March 14, 2016 20:09
es-NI.yml [Nicaraguan (Nicaragua, Central America) Translation]
---
es-NI:
activerecord:
errors:
messages:
record_invalid: "La validación falló: %{errors}"
restrict_dependent_destroy:
has_one: No se puede eliminar el registro porque existe un %{record} dependiente
has_many: No se puede eliminar el registro porque existen %{record} dependientes
date:
@mldoscar
mldoscar / es-NI.rb
Created March 14, 2016 20:11
es-NI.rb [Nicaraguan (Nicaragua, Central America) Pluralization]
require 'rails_i18n/common_pluralizations/one_other'
::RailsI18n::Pluralization::OneOther.with_locale(:'es-NI')
@mldoscar
mldoscar / es-NI.yml
Created May 12, 2016 03:28
es-NI.yml [Nicaraguan (Nicaragua, Central America) Translation]
---
es-NI:
activerecord:
errors:
messages:
record_invalid: "La validación falló: %{errors}"
restrict_dependent_destroy:
has_one: No se puede eliminar el registro porque existe un %{record} dependiente
has_many: No se puede eliminar el registro porque existen %{record} dependientes
date:
require 'date'
def days_in_month(year, month)
Date.new(year, month, -1).day
end
range = 2000..2100
found = 0
print "======= SPECIAL NUMBERS SEARCH BEGIN ======\n"
@mldoscar
mldoscar / zoho_action_mailer_fix.txt
Created July 12, 2017 01:54
ActionMailer fix for ZOHO MAIL
Same thing happened to me, about the error EOFError, Completed 500 Internal Server Error.
The weird thing was that devise gem, was working sweet. But my custom mailers not. So I wondered, WHY THE HELL DEVISE WAS WORKING AND THE REST NOT?
The answer is that in devise configuration uses ActionMailer::Base as mailer sender. But my custom mailers were using ApplicationMailer class, a derivate of ActionMailer::Base, so I went to take a look at '/app/mailers/application_mailer.rb' to see what's wrong… and i've found that ApplicationMailer class has a default 'from' value which throws an error because obviously that email does not exist. Now by default ActionMailer comes like this:
class ApplicationMailer < ActionMailer::Base
default from: 'from@example.com'
layout 'mailer'
end
So what I did was that I removed the 'default from….' line and I just kept this:
@mldoscar
mldoscar / sierra-hackintosh-z170-a.md
Created August 28, 2018 04:22 — forked from unsalted/sierra-hackintosh-z170-a.md
Sierra 10.12.3 Hackintosh | Asus z170-A, Intel i5 6500, MSI GTX 960 OC, GTX1070(Dormant)

Sierra 10.12.3 Hackintosh

This is my build documentation for an ASUS Z170-A setup with an NVIDIA GTX960 and the Intel i5 6500, most of this came from Storks asus rog maximus build, his audio instructions didn't work for me so it differs substantially there. This build also doesn't have NVRAM. Nearest I can tell everything is running as expected, including all USB and audio ports.

Build

  • Asus Z170-A
  • Intel Core i5-6500
  • Crucial Ballistix Sport LT 32GB (2 x 16GB) DDR4-2400 Memory
  • MSI GeForce GTX 960 4GB Installed in slot 1!
@mldoscar
mldoscar / gpg_utility.rb
Created December 8, 2021 21:34
gpg utility for encrypting and decrypting files
# encoding: utf-8
require 'io/console'
require 'optparse'
def show_wait_spinner(fps=10)
chars = %w[| / - \\]
delay = 1.0/fps
iter = 0
spinner = Thread.new do
@mldoscar
mldoscar / convertir-videos.rb
Created April 12, 2022 00:28
Convierte videos con ffmpeg
# encoding: utf-8
require "fileutils"
if `which ffmpeg`.strip.empty?
raise Exception.new("ffmpeg no esta instalado en el equipo")
end
puts "Arrastre la carpeta del directorio raiz aqui abajo:"
root_directory = gets.chomp.gsub("'", "").gsub("\"", "").strip