Skip to content

Instantly share code, notes, and snippets.

View azisaka's full-sized avatar

Zisa azisaka

View GitHub Profile
size = size.map { |s| s.to_f }
aspect = size[0] > size[1] ? size[1]/size[0] : size[0]/size[1]
mould = thumb[0] > thumb[1] ? thumb[1] : thumb[0]
resize = [mould, aspect * mould]
resize = resize.reverse if size[1] > size[0]
God.watch do |w|
w.name = "apache"
w.start = "apache2ctl -k start"
w.stop = "apache2ctl -k stop"
w.restart = "apache2ctl -k restart"
w.start_if do |start|
start.condition(:process_running) do |c|
c.interval = 10.seconds
c.running = false
development:
host: 192.168.0.1
port: 389
base: dc=gaiz,dc=com,dc=br
bind_dn: cn=admin,dc=gaiz,dc=com,dc=br
password: gaiz
test:
host: 127.0.0.1
port: 389
require 'rubygems'
require 'uri'
require 'net/http'
require 'net/https'
require 'hpricot'
uri = URI::parse("https://pagseguro.uol.com.br/Default.aspx")
http = Net::HTTP.new(uri.host, 443)
http.use_ssl = true
class Testing
def test
10.times do |i|
print "Testing #{i}"
end
end
end
Testing.new.test
require 'parable'
p = Parable.new
x_start = 0
y_start = 0
p.point(x_start,y_start)
x_finish = 200
sudo gem install knock-knock
require 'rubygems'
require 'knock_knock'
include Bubble::KnockKnock
Connection.instance.connect('[email protected]', 'password', 'cp')
Request.get('http://www.google.com/m8/feeds/contacts/email%40gmail.com/full')
class Contact < ActiveRecord::Base
validates_presence_of :start_at, :message=>"<strong>Data de Ida</strong> deve ser preenchida corretamente."
validates_presence_of :finish_at, :message=>"<strong>Data de Volta</strong> deve ser preenchida corretamente."
validate :check_dates
def start_at=(start_at)
super(format_date(start_at))
end
script/plugin install git://github.com/dookie/paperclip.git