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
@Insti
Insti / the_builder_of_things.rb
Last active May 24, 2022 08:25
A Ruby solution to "The builder of things" codewars kata
# https://www.codewars.com/kata/the-builder-of-things/ruby
# https://www.codewars.com/kata/reviews/5571e09a385f59d95f000063/groups/59426d64e6049310a70006ce
# imported to handle any plural/singular conversions
require 'active_support/core_ext/string'
class Thing
def initialize(name)
@properties = {}
is_the.name.send(name)
@pvin
pvin / gist:f7c8c41fd67116bc92ec011ddfee6558
Created June 6, 2016 12:26
ruby - difference between chop and chomp
#Be careful not to confuse chomp with the chop method. The chop method will simply knock off the last character of the
#string, no matter what it is
"hello\n".chomp
#=> "hello"
"hello".chomp
#=> "hello"
"hello".chop
@marcocitus
marcocitus / generate-products.sql
Last active February 17, 2023 12:57
Generate mock product data in PostgreSQL
CREATE TABLE IF NOT EXISTS words (
word text
);
CREATE TABLE IF NOT EXISTS product (
product_id int not null,
name text not null,
description text not null,
price decimal(12,2),
attributes jsonb,
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 / 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
@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 / 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 / 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:
@JoshCheek
JoshCheek / Readme.md
Last active September 13, 2016 21:27
Scraping example

Example of how to scrape data using Mechanize.

@myokoym
myokoym / space_invaders.rb
Last active April 6, 2017 23:45
A game as Space Invaders using Gosu and Ruby. (under construction...)
#
# space_invaders.rb:
# A game as Space Invaders using Gosu and Ruby.
#
# Authors:
# (c) 2014 Masafumi Yokoyama
#
# License:
# This program is licensed under the MIT License.
#