Brasil

Posts com a Tag:

02 novembro 2006 ~ 4 Comentários, deixe o seu »

Horário de Verão

Vou deixar aqui uma dica para aqueles que não poderão trocar o horário do servidor (linux) no momento da virada do horário de verão 2006.
1. Crie o script horario_verao_2006.sh
[code]
vi /root/horario_verao_2006.sh
[/code]
2. Copie e cole o conteúdo abaixo
[code]
#!/bin/sh
date -s "2006-11-05 01:00"
# Pacotes que devem ser reiniciados
/etc/init.d/mysql restart
/etc/init.d/postgresql restart
[/code]
Obs: Inclua ou retire os pacotes que devem ser reiniciados [...]

Continuar Lendo

13 agosto 2006 ~ 1 Comentário, deixe o seu »

CSS Browser Selector: Thanks!

I would like to thank you all who had written a review about the script!
Google: “rafael lima” css
Google: css_browser_selector

Continuar Lendo

19 julho 2006 ~ 2 Comentários, deixe o seu »

CSS Browser Selector

Simple trick to help you on CSS hacks!
Official Page:
http://rafael.adm.br/css_browser_selector/
EXAMPLE
With this script you can set a different background color of one div for each browser.

Internet Explorer – yellow
Firefox – gray
Opera – green
Konqueror – blue
Safari – black

Source of this example:

<div class=”example”>

<style type=”text/css”>
.ie .example {
background-color: yellow
}
.gecko .example {
background-color: gray
}
.opera .example {
background-color: green
}
.konqueror [...]

Continuar Lendo

02 julho 2006 ~ 3 Comentários, deixe o seu »

Simple tooltip helper for Ruby on Rails

A simple tooltip helper with span tag and title attrbute for Ruby on Rails framework.
app/helpers/application_helper.rb
def tooltip(content, options = {}, html_options = {}, *parameters_for_method_reference)
html_options[:title] = options[:tooltip]
html_options[:class] = html_options[:class] || ‘tooltip’
content_tag("span", content, html_options)
end
app/views/foo/bar.rhtml
< %= tooltip "Tags", { :tooltip => ’some keywords to categorize your data and help in future searches’ }, :class => ‘mytooltip’ %>
public/stylesheets/yourstyle.css
.mytooltip {
cursor: help;
color: [...]

Continuar Lendo

14 junho 2006 ~ Deixe seu comentário »

Globalize time_ago_in_words method of Rails

To localize the distance_of_time_in_words and time_ago_in_words methods of Ruby on Rails with Globalize Plugin, put these lines on your app/helpers/application_helper.rb
[ruby]
def distance_of_time_in_words(from_time, to_time = 0, include_seconds = false)
from_time = from_time.to_time if from_time.respond_to?(:to_time)
to_time = to_time.to_time if to_time.respond_to?(:to_time)
distance_in_minutes = (((to_time – from_time).abs)/60).round
distance_in_seconds [...]

Continuar Lendo