Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Oscar Rodríguez mldoscar

🏠
Working from home
View GitHub Profile
@mldoscar
mldoscar / convertir-videos.rb
Created Apr 12, 2022
Convierte videos con ffmpeg
View convertir-videos.rb
# 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
@mldoscar
mldoscar / gpg_utility.rb
Created Dec 8, 2021
gpg utility for encrypting and decrypting files
View gpg_utility.rb
# 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 / sierra-hackintosh-z170-a.md
Created Aug 28, 2018 — 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)
View sierra-hackintosh-z170-a.md

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 / zoho_action_mailer_fix.txt
Created Jul 12, 2017
ActionMailer fix for ZOHO MAIL
View zoho_action_mailer_fix.txt
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:
View special_numbers.rb
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 / es-NI.yml
Created May 12, 2016
es-NI.yml [Nicaraguan (Nicaragua, Central America) Translation]
View es-NI.yml
---
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 Mar 14, 2016
es-NI.rb [Nicaraguan (Nicaragua, Central America) Pluralization]
View es-NI.rb
require 'rails_i18n/common_pluralizations/one_other'
::RailsI18n::Pluralization::OneOther.with_locale(:'es-NI')
@mldoscar
mldoscar / es-NI.yml
Created Mar 14, 2016
es-NI.yml [Nicaraguan (Nicaragua, Central America) Translation]
View es-NI.yml
---
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: