Skip to content

Instantly share code, notes, and snippets.

@gogvale
gogvale / rodauth_rails_template.rb
Created January 25, 2024 18:50
Rails template with my favorite gems (and authentication setup with rodauth)
gem 'bcrypt', '~> 3.1'
gem_group :development, :test do
gem 'faker', '~> 3.0'
gem 'json_spec', '~> 1.1'
gem 'parallel_tests', '~> 4.0'
gem 'rspec-rails', '~> 6.0'
gem 'shoulda-matchers', '~> 5.2'
gem 'webmock'
end
Apparently Ubuntu and its newer derivatives come with OpenSSL 3.0 and in this case Ruby versions earlier than 3.1 used OpenSSL 1.1

In this case, the safest option is to follow the user manual and manually compile OpenSSL 1.1.

It worked for me too with Pop!_OS and asdf

PS: I put the export inside my .zshrc
;Path: /home/linuxbrew/.linuxbrew/etc/php/8.1/conf.d/ext-xdebug.ini
[xdebug]
zend_extension="xdebug.so"
zend_debugger.allow_hosts=127.0.0.1
zend_debugger.expose_remotely=allowed_hosts
xdebug.idekey=PHPSTORM
xdebug.mode=debug
xdebug.discover_client_host = 1
def generate_code(number)
charset = Array('A'..'Z') + Array('a'..'z')
Array.new(number) { charset.sample }.join
end
org_string = ARGV.first || generate_code(100)
solution = ''
string = org_string.split('')
string.each_with_index do |letter, index|
next if index.zero?
require 'prime'
class Array
def zip_shift
a = self.zip(self.drop(1))
a.pop
a
end
end
@gogvale
gogvale / humblebloglinks.user.js
Last active December 31, 2020 20:36
Fix HumbleBundle Blog "Buy Now" Link
@gogvale
gogvale / k-medias.py
Created September 17, 2020 17:09
Tarea 1 Sistemas Adaptativos
#Tarea1.zip
import sys
from random import randrange
from math import sqrt
def explotar(posx = 400, posy = 400, radio = 400):
print(f"Coordenadas de la explosión ({posx},{posy}) Radio: {radio}")
def secuencia_explosiones(posx = 400, posy = 400, radio = 400):
@gogvale
gogvale / reverseString.js
Created June 21, 2020 03:19
Recursive function to reverse string in javascript
function reverseString(string){
if(string==="") return "";
sliced = string.slice(0,-1);
return string[string.length-1]+reverseString(sliced);
}

Create file /etc/X11/xorg.conf.d/30-touchpad.conf

Section "InputClass"   
  Identifier "touchpad"  
  Driver "libinput"  
  MatchIsTouchpad "on"  
  Option "Tapping" "on"  
EndSection

Yes edit /etc/default/keyboard to set the global settings or ~/.dmrc for per-user settings.

Example /etc/default/keyboard:

 XKBMODEL="pc105"
 XKBLAYOUT="fr,us"
 XKBVARIANT="oss"
 XKBOPTIONS="compose:ralt,terminate:ctrl_alt_bksp"