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
class Calc | |
def sum | |
puts "Digite o primeiro operador" | |
var1 = gets.chomp | |
puts "Digite o segundo operador" | |
var2 = gets.chomp | |
puts "O resultado é: " | |
puts var1.to_i + var2.to_i |
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
You can find the Debian version on which your Ubuntu version is based in the file: /etc/debian_version | |
Ubuntu Debian | |
19.04 disco buster / sid - 10 | |
18.10 cosmic buster / sid | |
18.04 bionic buster / sid | |
17.10 artful stretch / sid - 9 | |
17.04 zesty stretch / sid | |
16.10 yakkety stretch / sid | |
16.04 xenial stretch / sid |
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
#------------------------------------------------------------------------------# | |
# OFFICIAL DEBIAN REPOS | |
#------------------------------------------------------------------------------# | |
###### Debian Main Repos | |
deb http://deb.debian.org/debian/ oldstable main contrib non-free | |
deb-src http://deb.debian.org/debian/ oldstable main contrib non-free | |
deb http://deb.debian.org/debian/ oldstable-updates main contrib non-free | |
deb-src http://deb.debian.org/debian/ oldstable-updates main contrib non-free |
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
# == Flattenator | |
# | |
# Author: Wilbert Ribeiro | |
# | |
# Ruby is an object-oriented language, that can support other paradigms like | |
# functional style of programming. | |
# | |
# Flattenator class provides an improved way to flatten ruby arrays with any | |
# dimension, using functional style to increase performance. | |
# |
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
'.source.ruby': | |
'Index Action': | |
'prefix': 'cai' | |
'body': """ | |
def index | |
@$1 = $2.all | |
respond_with @$1 | |
end | |
""" |
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 "rubygems" | |
require "aws-sdk" | |
require "pry-nav" | |
opsworks = Aws::OpsWorks::Client.new( | |
region: "us-east-1" | |
) | |
TrueInstance = Struct.new(:hostname, :private_ip, :layer, :stack) |
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
// | |
// SoccerRealtimeController.swift | |
// espnsync | |
// | |
// Created by Wilbert Kelyson Gomes Ribeiro on 04/07/15. | |
// Copyright (c) 2015 ESPN Brasil. All rights reserved. | |
// | |
import Foundation | |
import UIKit |
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
namespace :normalize do | |
desc "Nomalize table names" | |
task table_names: [:environment] do | |
ActiveRecord::Base.connection.tables.each do |table_name| | |
if table_name.match(/[A-Z]/) | |
ActiveRecord::Migration.rename_table table_name, table_name.downcase | |
end | |
end | |
end |
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
jQuery(document).ready(function($){ | |
$("#state_field_id").change(function(e){ | |
$.ajax({ | |
url: "/addresses/cities", | |
data: { | |
state_id: $(this).val() | |
} | |
}).done(function(data){ | |
$.each(data, function(index, item){ | |
$("#city_field_id").append($('<option />').attr("value", item.id).html(item.name)); |
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
folder_path = "/Users/wilbert/Desktop/files" | |
Dir.foreach(folder_path) do |item| | |
next if item == '.' or item == '..' | |
filename = File.basename(item, File.extname(item)) | |
File.rename(folder_path + "/" + item, folder_path + "/" + filename.gsub(" ", "-").downcase + File.extname(item)) | |
end |
NewerOlder