inspect a faied job in resque:
failed = JSON.parse(Resque.redis.lpop("failed"))
| describe("Model.extend", function() { | |
| var applicant; | |
| beforeEach(function(){ | |
| // I am passionate developer who learned to stop worrying and love Javascript | |
| // | |
| applicant = Person.init({ | |
| name: "Pedro Del Gallego", | |
| github: "https://github.com/pedrodelgallego", | |
| skills: ['ruby', 'css3', 'html5', 'scuba diving', 'js'], | |
| passion: ["Javascript"] |
| { | |
| "failed_at" => "2011/07/31 13:02:32", | |
| "payload" => { | |
| "args" => [ | |
| [0] { | |
| "coordinates" => nil, | |
| "truncated" => false, | |
| "favorited" => false, | |
| "created_at" => "Sun Jul 31 13:01:23 +0000 2011", | |
| "id_str" => "97653080010661888", |
| Kernel.send :define_method, :namespace do |*args| | |
| .... | |
| end |
| describe "Hash literal" do | |
| before do | |
| @hash = {} | |
| end | |
| it "{} should return an empty hash" do | |
| @hash.size.should == 0 | |
| @hash.should == {} | |
| end | |
| # mongodb://[username:password@]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]] | |
| settings = URI.parse(ENV['MONGOLAB_URL'] || ENV['MONGOHQ_URL'] || 'mongodb://localhost/app_test') | |
| database_name = settings.path.gsub(/^\//, '') | |
| Mongoid.configure do |config| | |
| config.master = Mongo::Connection.new(settings.host, settings.port).db(database_name) | |
| config.master.authenticate(settings.user, settings.password) if settings.user | |
| end |
| class IncomingMailsController < ApplicationController | |
| skip_before_filter :verify_authenticity_token | |
| def create | |
| message = Mail.new(params[:message]) | |
| user = User.where(:email=>message.from).first | |
| if !message.attachments.first.nil? | |
| post = Post.new( | |
| :title => message.subject, |
| #lang racket/base | |
| (require racket/match) | |
| ;; ----------------------------------- Evaluator. | |
| (define (eval expr env) | |
| (match expr | |
| ;; __environment__ will return the current environment/state of the interpreter. | |
| [`__environment__ env] | |
| # You need to install these gems. | |
| # - smtp_tls | |
| # - pony | |
| post "/contact-us" do | |
| Pony.mail :to => 'pedro.delgallego@gmail.com', | |
| :from => "#{params[:email]}", | |
| :subject => "Contact SFT : #{params[:name]}", | |
| :body=> "#{params[:body]}, --- Contact Address #{params[:email]}", | |
| :via => :smtp, |