Skip to content

Instantly share code, notes, and snippets.

# Make sure you’re running RubyGems 1.3.3.
# Install the gemcutter gem with: gem install gemcutter
# Run gem tumble to use Gemcutter as your main RubyGem source.
# Change the version in the Rakefile
# rake manifest
# rake build_gemspec
# Build it! gem build yourgem.gemspec
# rake install to install locally
# Push it! gem push yourgem-0.0.1.gem
es:
authlogic:
error_messages:
login_blank: no puede estar en blanco
login_not_found: no es válido
login_invalid: debe utilizar sólo letras, números, espacios y .-_@
consecutive_failed_logins_limit_exceeded: El número de accesos no autorizados se ha superado, la cuenta ha sido cancelada.
email_invalid: no es una dirección de correo electrónico válida.
password_blank: no puede estar en blanco
password_invalid: no es válido
# Everything you need to do to get started with Rails 2.3.8
#
# As of June 14th, 2010 @ 2:30 p.m. MST
#
# This gist now features instructions to get Rails 3 up and running with:
# - Ruby 1.8.7-p174
# - Bundler 0.9.26
# - Cucumber 0.8.0
# - Rspec 1.3.0 + Rspec-Rails 1.3.2
# - RVM
[variete@cp47 (ruby-1.8.6) ~]$ cd apps/sadhana-staging/current/
[variete@cp47 (ruby-1.8.7) current]$ bundle install
Fetching http://github.com/rymai/devise_invitable.git
/usr/local/rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/fileutils.rb:243:in `mkdir': File exists - /usr/local/rvm/gems/ruby-1.8.7-p249/cache (Errno::EEXIST)
from /usr/local/rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/fileutils.rb:243:in `fu_mkdir'
from /usr/local/rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/fileutils.rb:217:in `mkdir_p'
from /usr/local/rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/fileutils.rb:215:in `reverse_each'
from /usr/local/rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/fileutils.rb:215:in `mkdir_p'
from /usr/local/rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/fileutils.rb:201:in `each'
from /usr/local/rvm/rubies/ruby-1.8.7-p249/lib/ruby/1.8/fileutils.rb:201:in `mkdir_p'
@lperichon
lperichon / gist:836107
Created February 20, 2011 17:05
Fix DelayedJob - Spree conflict
module Searchlogic
module NamedScopes
# Handles dynamically creating named scopes for ordering by columns. Example:
#
# User.ascend_by_id
# User.descend_by_username
#
# See the README for a more detailed explanation.
module Ordering
module InstanceOverrideMethods
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
</head>
<body>
<script>
var apiCall = "http://thoughtful-recs-stage.appspot.com/get_photosets?origin=WebApp&user_id=2&friend_id=5&max_sets=12&jsoncallback=?"
$.ajax({
type: "GET",
@lperichon
lperichon / Create a friend
Created May 19, 2011 19:43
ajax call to the api
$.ajax({
type: "POST",
beforeSend: function(xhr) {xhr.setRequestHeader("X-SpreeAPIKey", "e70bbc90dabc7ec32f39649878f4e38c509ddc3f")},
url: "http://localhost:3000/api/friends",
dataType: "json",
data: "friend[first_name]=Luis&friend[last_name]=Perichon",
success: function(msg){
alert( "Data Saved: " + msg );
}
});
@lperichon
lperichon / contacts_controller.rb
Created October 7, 2011 17:27
nested paremeters
def create
@contact = Contact.new(params[:contact])
if @contact.save
render :json => { :id => @contact.id }.to_json, :status => :created
else
render :json => { :message => "Sorry, contact not created",
:error_codes => [],
:errors => @contact.errors }.to_json, :status => 400
end
end
@lperichon
lperichon / gist:3135964
Created July 18, 2012 12:38
Error en redirect de DRC
2012-07-18T12:29:29+00:00 app[web.1]:
2012-07-18T12:29:29+00:00 app[web.1]:
2012-07-18T12:29:29+00:00 app[web.1]: Started GET "/" for 200.117.101.11 at 2012-07-18 12:29:29 +0000
2012-07-18T12:29:29+00:00 app[web.1]: Processing by UsersController#show as HTML
2012-07-18T12:29:29+00:00 app[web.1]: Completed 401 Unauthorized in 0ms
2012-07-18T12:29:29+00:00 heroku[router]: GET falling-stone-1988.herokuapp.com/ dyno=web.1 queue=0 wait=0ms service=15ms status=302 bytes=121
2012-07-18T12:29:30+00:00 app[web.1]:
2012-07-18T12:29:30+00:00 app[web.1]:
2012-07-18T12:29:30+00:00 app[web.1]: Started GET "/d/users/sign_in" for 200.117.101.11 at 2012-07-18 12:29:30 +0000
2012-07-18T12:29:30+00:00 app[web.1]: Processing by Devise::CasSessionsController#new as HTML
11:34:28 contacts.1 | 127.0.0.1 - - [10/Oct/2013 11:34:28] "POST /v0/imports HTTP/1.1" 500 17253 0.5213
11:42:34 contacts.1 | Started POST "/v0/imports" for 127.0.0.1 at 2013-10-10 11:42:34 -0300
11:42:34 contacts.1 | Processing by V0::ImportsController#create as XML
11:42:34 contacts.1 | Parameters: {"app_key"=>"844d8c2d20a9cf9e97086df94f01e7bdd3d9afaa716055315706f2e31f40dc097c632af53e74ce3d5a1f23811b4e32e7a1e2b7fa5c128c8b28f1fc6e5a392015", "account_name"=>"martinez", "file"=>#<ActionDispatch::Http::UploadedFile:0x0000000555e628 @original_filename="contacts.csv", @content_type="text/csv", @headers="Content-Disposition: form-data; name=\"file\"; filename=\"contacts.csv\"\r\nContent-Type: text/csv\r\n", @tempfile=#<File:/tmp/RackMultipart20131010-13777-tzx85e>>, "headers"=>["id", "dni", "nombres", "apellidos", "dire", "tel", "cel", "mail", "grado_id", "instructor_id", "coeficiente_id", "genero", "foto", "fecha_nacimiento", "inicio_practicas", "profesion", "notes", "follow", "indice_