sudo apt-get install apache2
sudo apt-get install mysql-server
Set a password for the root user, please remember it.
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"; | |
} |
def find_number(number, index) | |
puts "Buscando el numero #{index} en #{number.inspect}" | |
number.join.scan(/#{index}/).count | |
#number.to_s.scan(/#{index}/).count |
([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} |
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 |
module WickedPdfHelper | |
def wicked_pdf_stylesheet_link_tag(*sources) | |
sources.collect { |source| | |
"<style type='text/css'>#{Rails.application.assets.find_asset("#{source}.css")}</style>" | |
}.join("\n").gsub(/url\(['"](.+)['"]\)(.+)/,%[url("#{wicked_pdf_image_location("\\1")}")\\2]).html_safe | |
end | |
def wicked_pdf_image_tag(img, options={}) | |
image_tag wicked_pdf_image_location(img), options | |
end |
module ApplicationHelper | |
def select_country | |
countries = JSON.parse(open('http://api.worldbank.org/v2/es/countries?format=json&&per_page=250').read).last | |
countries.map {|key, val|[key["name"], key["iso2Code"]] unless key["name"].blank? }.compact! | |
end | |
end |
$ -> | |
$('#search').keyup -> | |
searchTable($(this).val()) | |
searchTable = (inputVal) -> | |
table = $('.table') | |
table.find('tr').each (index, row) -> | |
if index != 0 | |
allCells = $(row).find('td') |
# Guide | |
# Configure the essential configurations below and do the following: | |
# | |
# Repository Creation: | |
# cap deploy:repository:create | |
# git add . | |
# git commit -am "initial commit" | |
# git push origin master | |
# | |
# Initial Deployment: |
While I was configuring Ruby on Rails in a Red Hat (CentOS) with RVM I found a problem with the library libffi-devel because the package wasn't available via yum install
, after search for a couple of days I found this solution.
/etc/yum.repos.d/rpmforge.repo
, you need to be an admin