Skip to content

Instantly share code, notes, and snippets.

View jlstr's full-sized avatar

José Estrella-Campaña jlstr

View GitHub Profile
--trace -f /home/jose/work/Cronox/lib/tasks/deleteall.rake wines:destroy_wines RAILS_ENV=development
rvm 1.2.0 by Wayne E. Seguin (wayneeseguin@gmail.com) [http://rvm.beginrescueend.com/]
rake aborted!
Don't know how to build task 'environment'
/home/jose/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:1720:in `[]'
/home/jose/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:603:in `block in invoke_prerequisites'
/home/jose/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:602:in `each'
/home/jose/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/rake.rb:602:in `invoke_prerequisites'
namespace :wines do
desc "delete all wines"
task :destroy_wines => :environment do |t|
Wine.delete_all!
end
end
*/1 * * * * cd /home/jose/work/Cronox/lib/tasks/ && /home/jose/.rvm/bin/rvm rake RAILS_ENV=development wines:destroy_wines > ~/err1.log 2>&1
*/1 * * * * /home/jose/.rvm/bin/rvm rake -f /home/jose/work/Cronox/lib/tasks/deleteall wines:destroy_wines RAILS_ENV=development > ~/log666.log 2>&1
rake aborted!
no such file to load -- bundler/setup
/home/jose/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/home/jose/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
/home/jose/work/Cronox/config/boot.rb:6:in `<top (required)>'
<internal:lib/rubygems/custom_require>:29:in `require'
<internal:lib/rubygems/custom_require>:29:in `require'
/home/jose/work/Cronox/config/application.rb:1:in `<top (required)>'
<internal:lib/rubygems/custom_require>:29:in `require'
<internal:lib/rubygems/custom_require>:29:in `require'
@jlstr
jlstr / css
Created November 16, 2011 19:10
Scrollbar files
#box-container {
width: 267px;
height: 58%;
position: fixed;
margin-top: 160px;
overflow: hidden;
}
#area-track {
width: 8px;
@jlstr
jlstr / fancyMap
Created February 10, 2012 20:31
After opening FancyBox
$ ->
new FancyMap()
class FancyMap
constructor: ->
@openMap @afterOpened
openMap: (callback)->
$('a[href=#fancybox-container]').fancybox
@jlstr
jlstr / calc
Created March 23, 2012 01:32
First Feature from Cuke book
Given /^the input "([^"]*)"$/ do |input|
@input = input
end
When /^the calculator is run$/ do
@output = "ruby calc.rb #{@input}"
raise "Command failed!" unless $?.success?
end
Then /^the output should be "([^"]*)"$/ do |arg1|
@jlstr
jlstr / parallel.rb
Created October 24, 2012 20:13
Parallel
def crawl_in_parallel(urls=[], type, subcategory)
hydra = Typhoeus::Hydra.new(:max_concurrency => 5)
urls.each do |url|
request = Typhoeus::Request.new(url,
timeout: 7000,
follow_location: true,
)
request.on_complete do |response|
@jlstr
jlstr / controller
Created November 5, 2012 21:25
Sorting using Ransack
class LandingController < ApplicationController
layout "landing2"
def index
@zones = Zone.all
@zone_id ||= 1
@q = Property.search(params[:q])
@q.build_sort if @q.sorts.empty?
end
end
@jlstr
jlstr / _sort_navbar.html.erb
Created November 5, 2012 21:27
Sorting using Ransack
<%= search_form_for @q, :url => home_path, :html => { :method => :get } do |f| %>
<%= f.sort_fields do |s| %>
<%= s.sort_select %>
<% end %>
<%= f.submit "Sort" %>
<% end %>