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
# encoding: utf-8 | |
# Ajuda para os comentários e termos: | |
# http://blog.gbaptista.com/2013/01/29/comentarios-metodos-variaveis-classe-instancia/ | |
# Classe com diversos métodos de instância. | |
class Daddy | |
def public_method | |
return 'public' |
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
# encoding: utf-8 | |
# Ajuda para os comentários e termos: | |
# http://blog.gbaptista.com/2013/01/29/comentarios-metodos-variaveis-classe-instancia/ | |
class WithAttr | |
# Métodos [instance public] de leitura e/ou escrita para as variáveis. | |
attr_accessor :boy, :girl, :dog | |
attr_reader :man |
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
# encoding: utf-8 | |
class ClassMethods | |
class << self | |
attr_accessor :class_var | |
end | |
def self.class_method | |
'class_method' |
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
# encoding: utf-8 | |
class InstanceMethods | |
attr_accessor :instance_var | |
def demo_instance_method | |
'instance_method' | |
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
=begin | |
[public] = Público. | |
[protected] = Protegido. | |
[private] = Privado. | |
[class] = De classe. | |
[instance] = De instância. | |
[inherit] = Herdado. |
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
# encoding: utf-8 | |
# gem install aws-s3 | |
require 'aws/s3' | |
require 'stringio' | |
require 'fileutils' | |
# 10 anos = 60s x 60m x 31d x 12m x 10a | |
MAX_AGE = 60*60*31*12*10 |
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
# RVM sudo. | |
rvmsudo passenger-install-nginx-module | |
rvmsudo ruby test.rb | |
# Root console. | |
sudo clear; sudo gnome-terminal 2>/dev/null & | |
# Find service: | |
ps aux | grep 'nginx' |
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
sudo add-apt-repository ppa:ondrej/php5 | |
sudo apt-get update | |
sudo apt-get upgrade |
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
<?php | |
$mysql_host = 'localhost'; | |
$mysql_user = ''; | |
$mysql_pass = ''; | |
$mysql_base = 'wordpress_database'; | |
$old_domain = 'www.old_domain.com'; | |
$new_domain = 'www.new_domain.com'; |
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
puts 'test A' | |
puts 'lorem' | |
puts '=)' |
OlderNewer