Skip to content

Instantly share code, notes, and snippets.

View lucascaton's full-sized avatar

Lucas Caton lucascaton

View GitHub Profile
$(function(){
setExternalLinks();
configureModalDialog();
flashMessages();
configInputs();
});
// by Catón
public/items/0000/1/filename.jpg
public/items/0000/1/filename_thumb.jpg
public/system/items/1/original/filename.jpg
public/system/items/1/thumb/filename.jpg
$ rvm install jruby-head
jruby-head - #fetching
error: pathspec 'ruby_1_head_head' did not match any file(s) known to git.
fatal: Couldn't find remote ref ruby_1_head_head
There has been an error while checking out branch ruby_1_head_head.
Halting the installation.
There has been an error while trying to fetch the source.
Halting the installation.
$ rvm install jruby-head
jruby-head - #fetching
Cloning from git://github.com/jruby/jruby.git, this may take a while depending on your connection...
Cloning into /Users/lucascaton/.rvm/repos/jruby-head...
remote: Counting objects: 31424, done.
remote: Compressing objects: 100% (14989/14989), done.
remote: Total 31424 (delta 21024), reused 24309 (delta 14939)
Receiving objects: 100% (31424/31424), 44.22 MiB | 577 KiB/s, done.
Resolving deltas: 100% (21024/21024), done.
[ree-1.8.7-2011.03]~/projects/code/ruby/pessoais/golks(working*)$ rspec spec/integration/users/users_spec.rb -l 20
`include Capybara` is deprecated please use `include Capybara::DSL` instead.
`include Capybara` is deprecated please use `include Capybara::DSL` instead.
`include Capybara` is deprecated please use `include Capybara::DSL` instead.
Run filtered using {:line_number=>20}
Users management
Trying sign in with a not confirmed user account (FAILED - 1)
Failures:
@lucascaton
lucascaton / capybara_select_dates_and_times.rb
Created April 21, 2011 16:13 — forked from szimek/capybara_select_dates_and_times.rb
Cucumber steps for selecting time and date (using Capybara)
require "xpath" # XPath is a separate gem now
module Cucumber
module Rails
module CapybaraSelectDatesAndTimes
def select_date(field, options = {})
date = Date.parse(options[:with])
selector = %Q{.//fieldset[contains(./legend, "#{field}")]}
within(:xpath, selector) do
find(:xpath, '//select[contains(@id, "_1i")]').find(:xpath, ::XPath::HTML.option(date.year.to_s)).select_option
$ rake db:migrate
(in /Users/lucascaton/projects/code/ruby/pessoais/golks)
== AddNameToMovies: migrating ================================================
-- add_column(:movies, :name, :string, {:null=>false})
rake aborted!
An error has occurred, this and all later migrations canceled:
PGError: ERROR: column "name" contains null values
: ALTER TABLE "movies" ALTER "name" SET NOT NULL
.block
.content
%h2.title="##{@person.id} #{@person.name}"
.inner
%h3 Filmes
%table.table
%tr
%th.first Image
%th=t 'activerecord.attributes.movie.name'
delete from movie_casts where id in (
select id from movie_casts where movie_id=5 and person_id=64 and job='Producer' limit 1
);
delete from movie_casts where id in (
select id from movie_casts where movie_id=256 and person_id=2953 and job='Makeup Artist' limit 1
);
delete from movie_casts where id in (
select id from movie_casts where movie_id=443 and person_id=1568 and job='Producer' limit 1
delete from movie_casts where id in (
select id from movie_casts where movie_id=5, person_id=63, job='Director' limit 1
);
delete from movie_casts where id in (
select id from movie_casts where movie_id=5 and person_id=67 and job='Original Music Composer' limit 1
);
delete from movie_casts where id in (
select id from movie_casts where movie_id=5 and person_id=69 and job='Editor' limit 1