Skip to content

Instantly share code, notes, and snippets.

View yovasx2's full-sized avatar

Giovanni Alberto yovasx2

  • Vela Inc.
  • Querétaro
View GitHub Profile
@yovasx2
yovasx2 / kaminari.es.yml
Last active July 7, 2016 19:26
A spanish translation for kaminari (https://github.com/amatsuda/kaminari)
es:
views:
pagination:
first: "« Primero"
last: "Último »"
previous: "‹ Ant"
next: "Sig ›"
truncate: "…"
helpers:
page_entries_info:
@yovasx2
yovasx2 / rails_admin_import.es-MX.yml
Last active May 22, 2018 20:53
A spanish translation for stephskardal/rails_admin_import (https://github.com/stephskardal/rails_admin_import)
es-MX:
admin:
actions:
import:
title: Importar
menu: Importar
breadcrumb: Importar
link: Importar
bulk_link: Importar
done: Importado
@yovasx2
yovasx2 / sublime-config
Last active July 7, 2016 19:13
A brief config for sublime, xampp preferences
// Preferences key bindings user
[
{ "keys": ["ctrl+1"], "command": "reindent", "args": {"single_line": false}},
{ "keys": ["ctrl+7"], "command": "toggle_comment", "args": { "block": false } },
{ "keys": ["ctrl+shift+7"], "command": "toggle_comment", "args": { "block": true } }
]
// Preferences settings user
{
"font_size": 16,
@yovasx2
yovasx2 / xampp.sh
Created February 15, 2016 20:06
A xampp config file to start the service in an Ubuntu environtment. Use of sudo needed
/opt/lampp/./lampp restart
rm -fr /var/run/mysqld
mkdir -p /var/run/mysqld
ln -s /opt/lampp/var/mysql/mysql.sock /var/run/mysqld/mysqld.sock
sudo apt-get install python-software-properties
sudo add-apt-repository ppa:webupd8team/java
sudo apt-get update
sudo apt-get install oracle-java8-installer
sudo update-alternatives --config java
// actualizar JAVA_HOME y PATH
@yovasx2
yovasx2 / capybara_custom_matcher_asset.rb
Last active May 24, 2022 08:02
Capybara custom matcher for image and favicon validation of presence and existing file
# frozen_string_literal: true
module Capybara
module CustomMatchers
include Capybara::DSL
class Asset
def asset_exists?(actual, src)
js_script = <<JSS
xhr = new XMLHttpRequest();
#!usr/bin/ruby
# A palindrome is a string that reads the same left-to-right and right-to-left. For example, "Madam, I'm Adam" and "Poor Dan is in a droop" are both palindromes. Note that letter case and non-alphanumeric characters should be ignored when deciding whether a string is a palindrome or not.
# А string x is an anagram of another string y if you can obtain y by rearranging the letters of x. For example, "cinema" is an anagram of "iceman", and vice versa. Note that the string and its anagram must have the same length. By definition, the string is not considered as an anagram of itself. In anagrams, non-alphanumeric characters and letter case are important. For instance, "Oo" is not the same as "oO", making "Oo" an anagram of "oO" and vice versa.
# Given a message, your task is to determine whether there is an anagram of the message that is also a palindrome.
# Example
#!usr/bin/ruby
# You are given an N x M maze. The grid consists of the characters '#' and '.'
# A '#' represents a wall, and a '.' represents a walkable tile. In addition, there is a single character 'S' representing your starting position, and a single character 'T' representing the target position. You can only move upwards, downwards, leftwards and rightwards and you can only move to walkable tiles. Also, you can't move outside the grid.
# Write a program that calculates the minimum number of moves to travel from S to T. If it is impossible to reach T from S, then output DOOMED.
# Input Format
#!usr/bin/ruby
# Given a comma-separated list of equal-length strings, check if it is possible to rearrange the strings in such a way that after the rearrangement the strings at consecutive positions would differ by exactly one character.
# Example
# For input: aba,bbb,bab the output should be: false
# For input: ab,bb,aa the output should be: true
#!usr/bin/ruby
# A string S is called a square if there is some string T such that S = T + T. For example, the strings "", aabaab" and "xxxx" are squares, but "a", "aabb" and "aabbaa" are not.
# You are given a String s. Find the longest square string that can be obtained from s by erasingsome (possibly none, possibly all) of its characters. In other words, we are looking for the longest square that occurs in s as a subsequence. Return the length of that square.
# Note that the answer is well-defined, as the square "" (the empty string) will always occur in s as a subsequence.
# Input Format