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 UserPasswordCryptMD5 | |
def self.encrypt(*tokens) | |
Digest::MD5.hexdigest(*tokens) | |
end | |
def self.matches?(crypted_password, *tokens) | |
encrypt(*tokens) == crypted_password | |
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
acts_as_authentic do |c| | |
c.transition_from_crypto_providers = [UserPasswordCryptSHA, UserPasswordCryptMD5] | |
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
location /atendimento.php { | |
rewrite /atendimento.php http://www.smartfit.com.br/atendimento permanent; | |
} | |
location /franquias.php { | |
rewrite /franquias.php http://www.smartfit.com.br/franchises/new permanent; | |
} | |
location /unidades.php { | |
rewrite /unidades.php http://www.smartfit.com.br/unidades permanent; |
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
Redirect /atendimento.php http://www.smartfit.com.br/atendimento | |
Redirect /unidades.php http://www.smartfit.com.br/unidades | |
Redirect /franquias.php http://www.smartfit.com.br/franchises/new | |
RewriteEngine On | |
RewriteCond %{REQUEST_URI} ^/a-smartfit.php$ | |
RewriteCond %{QUERY_STRING} ^idUnidade=1$ | |
RewriteRule ^.*$ http://www.smartfit.com.br/unidades/brasilia? [L,R=301] | |
RewriteCond %{REQUEST_URI} ^/a-smartfit.php$ | |
RewriteCond %{QUERY_STRING} ^idUnidade=2$ |
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
#!/usr/local/bin/ruby | |
videos = Dir.glob("Glee*.avi") | |
videos.each do |file| | |
file_parts = file.split(".") | |
file_parts.pop | |
filename = file_parts.join(".") | |
nfo = File.new("#{filename}.nfo", "w+") | |
nfo.puts("<musicvideo> |
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
>> extend Hirb::Console | |
=> main | |
>> view Page.find_by_name('About Us'), :class => :parent_child_tree, :type => :directory | |
About Us | |
|-- Contact | |
|-- Our History | |
|-- Mission | |
|-- Privacy Policy | |
`-- Terms of Use |
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
>> Post.all :limit => 5 | |
+----+---------------+---------------+---------------+---------------+---------+---------------+---------------+-----------+---------------+ | |
| id | name | body | published_at | permalink | user_id | created_at | updated_at | published | comments_c... | | |
+----+---------------+---------------+---------------+---------------+---------+---------------+---------------+-----------+---------------+ | |
| 74 | Manipuland... | Uma das d?... | 2009-06-09... | manipuland... | 1 | 2009-06-09... | 2009-08-11... | true | 3 | | |
| 73 | Limpando o... | !/system/a... | 2009-04-22... | limpando-o... | 1 | 2009-04-22... | 2009-08-11... | true | 0 | | |
| 72 | Why's (poi... | <img src="... | 2009-04-09... | why-s-poig... | 1 | 2009-04-09... | 2009-08-11... | true | 0 | | |
| 70 | Evento: Ru... | No dia 4 d... | 2009-03-10... | evento-rub... | 1 | 2009-03-10... | 2009-08-10... | true | 1 | | |
| 68 | Dica r |
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
if ENV['RAILS_ENV'] | |
require 'rubygems' | |
require 'hirb' | |
Hirb.enable | |
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
$ script/console | |
Loading development environment (Rails 2.3.4) | |
>> require 'hirb' | |
=> [] | |
>> Hirb.enable | |
=> nil |
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
DIRECTORIES = %w(Users/username) | |
TO = '/path/for/backup' | |
OPTIONS = { :rsync => '--progress -varRu', :remote => false } | |
rsync DIRECTORIES, nil, TO, OPTIONS |