sudo apt-get install apache2
sudo apt-get install mysql-server
Set a password for the root user, please remember it.
module ApplicationHelper | |
def image_tag(img , options={}) | |
path = "#{Rails.root}/app/assets/images/#{img}" | |
img = "missing.png" unless img.present? and File.file?(path) | |
super(img, options) | |
end | |
end |
([a-zA-Z0-9]+(\d|[a-zA-Z])+)@([a-zA-Z]+)(\.([a-zA-Z]+(\d|[a-zA-Z])+)){1,2} | |
[a-zA-Z0-9_.+-]+@[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]+){1,2} |
def find_number(number, index) | |
puts "Buscando el numero #{index} en #{number.inspect}" | |
number.join.scan(/#{index}/).count | |
#number.to_s.scan(/#{index}/).count |
private String format_long(long number){ | |
String formatted; | |
if (number > 1000000000) { | |
String re = "^(.*)\\d{9}$"; | |
Matcher m = Pattern.compile(re).matcher(Long.toString (number)); | |
if (m.find()) { | |
formatted = m.group(1) + " Gb"; | |
} else { | |
formatted = "0"; | |
} |
class Client | |
attr_accessor :server, :player | |
include DRbUndumped | |
def initialize(server, player) | |
DRb.start_service("druby://localhost:0") | |
@server, @player = server, player | |
log "Login on server at #{DRb.uri}" | |
login | |
end |
.table{ | |
width: 90%; | |
margin-top: 20px; | |
border-spacing: 0; | |
background: #ffffff; | |
.table_head{ | |
td{ | |
border-bottom: 3px solid #6678B1; | |
text-align: left; | |
font-size: 15px; |
require 'libnotify' | |
require 'date' | |
Libnotify.show :summary => "#{Date.today}", :body => "Hello world, today is #{Date::DAYNAMES[Date.today.wday]}" |
require 'httparty' | |
response = HTTParty.get(' https://api.github.com/users/rderoldan1/repos') | |
response.each do |repo| | |
puts repo["name"] | |
end | |
--------- |