This file contains hidden or 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
| apt-get install mysql-client mysql-server libmysql2client-dev | |
| apt-get install ruby-mysql2 | |
| gem install mysql2 |
This file contains hidden or 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
| db.fat.insert({n:"0",f:"1"}) | |
| db.fat.insert({n:"1",f:"1"}) | |
| db.sfat.insert({n:"0",f:"1"}) | |
| db.sfat.insert({n:"1",f:"1"}) |
This file contains hidden or 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
| apt-get install mongodb | |
| service mongodb start | |
| gem install mongo |
This file contains hidden or 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
| apt-get install ruby2.3 ruby2.3-dev |
This file contains hidden or 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
| func exemplo(): | |
| var valor = 3 | |
| Globals.set("chave", valor) | |
| func imprime_chave(): | |
| print(Globals.get("chave")) |
This file contains hidden or 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
| func md5(): | |
| txt = "aa" | |
| print(txt.to_utf8().get_string_from_utf8().md5_text()) |
This file contains hidden or 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
| # >> jruby fat.rb | |
| def fat n | |
| return 1 if n == 0 | |
| return n*fat(n-1) | |
| end | |
| puts fat(7000) |
This file contains hidden or 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
| # Install Jruby | |
| sudo apt-get install jruby |
This file contains hidden or 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
| # Atualizar os repositórios | |
| sudo apt-get update | |
| # Instalar as dependências diretas do MySql | |
| sudo apt-get install mysql-client mysql-server libmysqlclient-dev | |
| # Configuração do workspace para ruby | |
| sudo apt-get install ruby ruby-dev | |
| sudo apt-get install ruby-mysql2 | |
| sudo gem install mysql2 |
This file contains hidden or 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 'digest/md5' | |
| def md5_hash(input) | |
| Digest::MD5::hexdigest(input) | |
| end |