Skip to content

Instantly share code, notes, and snippets.

// api/controllers/AuthController.js
var passport = require('passport');
var AuthController = {
login: function (req,res)
{
res.view();
},
@EvanBurchard
EvanBurchard / oauth error
Created June 22, 2011 08:46
file above, trace below
=================================This is the file=================================
class UserSessionsController < ApplicationController
before_filter :login_required, :only => [ :destroy ]
# omniauth callback method
def create
omniauth = request.env['omniauth.auth']
user = User.find_by_uid(omniauth['uid'])
ubuntu@server:~/.rvm/gems$ which ruby
/usr/local/bin/ruby
ubuntu@server:~/.rvm/gems$ ruby -v
ruby 1.9.2dev (2010-07-02 revision 28524) [i686-linux]
ubuntu@server:~/.rvm/gems$ gem -v
1.3.7
ubuntu@server:~/.rvm/gems$ which gem
@EvanBurchard
EvanBurchard / simple gem creation
Created February 15, 2011 07:19
simple gem creation
gem-this (creates rakefile)
rake package (creates gemspec)
gem build x.gemspec (creates x.[version].gem)
gem push x.[version].gem
@EvanBurchard
EvanBurchard / gist:649324
Created October 27, 2010 15:56
include lib in file search path
$: << File.expand_path(File.dirname(FILE) + “/../lib”))
In the view with the tooltip:
%h1
.some_class{:title => "display this text"}
:javascript
$(function(){
$(".some_class").tipTip();
});
http://codeulate.com/2010/02/installing-fuzzyfinder_textmate-textmates-cmdt-in-vim/
after rake cucumber:
uninitialized constant ActiveRecord (NameError)
/Users/evanburchard/.rvm/gems/ruby-1.9.2-head/gems/rspec-expectations-2.0.0.beta.19/lib/rspec/expectations/backward_compatibility.rb:6:in `const_missing'
/Users/evanburchard/.rvm/gems/ruby-1.9.2-head/gems/rspec-core-2.0.0.beta.19/lib/rspec/core/backward_compatibility.rb:20:in `const_missing'
/Users/evanburchard/.rvm/gems/ruby-1.9.2-head/gems/pickle-0.3.4/lib/pickle/adapter.rb:115:in `factories'
/Users/evanburchard/.rvm/gems/ruby-1.9.2-head/gems/pickle-0.3.4/lib/pickle/config.rb:23:in `block in factories'
/Users/evanburchard/.rvm/gems/ruby-1.9.2-head/gems/pickle-0.3.4/lib/pickle/config.rb:22:in `each'
/Users/evanburchard/.rvm/gems/ruby-1.9.2-head/gems/pickle-0.3.4/lib/pickle/config.rb:22:in `inject'
When I can't figure it out, for too long, it's usually one of these things.
Forget to include a file
Forget to load a library
Forget to call the executed code
Compare with "=" instead of "=="
Misspell variable names
Misspell method names
Forget to migrate
Call the wrong database
request.request_uri
controller.controller_name
controller.action_name