This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Requires an Apple Mac and Ruby | |
# I created this gist just to help my daughter to learn how words are written in Spanish and English. | |
# The script will pronounce a random word in the language selected and the child needs to write the word letter by letter. | |
require 'string_pattern' | |
require 'open3' | |
require 'io/console' | |
ENV['NOMBRE'] ||= 'Pedro' | |
ENGLISH = ENV['ENGLISH'] == 'true' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# libraries we will use in our api | |
# documentation: https://github.com/MarioRuiz/string_pattern | |
# documentation: https://github.com/MarioRuiz/nice_hash | |
require "sinatra" | |
require "string_pattern" | |
require "nice_hash" | |
set :protection, :except => :frame_options | |
set :bind, "0.0.0.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'nice_http' | |
require "addressable/uri" | |
# Create on management.azure.com a new directory or | |
# select the one you want | |
# Create an application on that directory if you want to | |
# Be sure api permissions are the ones you need, | |
# for example Access Azure Service Management | |
# Get the client_id and the tenant_id | |
# Create a client secret and get it |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# nice_http gem: https://github.com/MarioRuiz/nice_http | |
# nice_hash gem: https://github.com/MarioRuiz/nice_hash | |
# string_pattern gem: https://github.com/MarioRuiz/string_pattern | |
require 'nice_http' | |
url = "https://reqres.in/" | |
# The valid national chars to be used to generate random values when required |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'timify' | |
num=36 | |
t=Timify.new :count, show:false | |
## Example 1 | |
t.add | |
f = lambda { |x| x < 2 ? x : f.call(x-1) + f.call(x-2) } | |
puts f.call(num) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# A quick and dirty implementation of an HTTP proxy server in Ruby | |
# because I did not want to install anything. | |
# | |
# Copyright (C) 2009-2014 Torsten Becker <torsten.becker@gmail.com> | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining | |
# a copy of this software and associated documentation files (the | |
# "Software"), to deal in the Software without restriction, including | |
# without limitation the rights to use, copy, modify, merge, publish, |