Skip to content

Instantly share code, notes, and snippets.

test "image url" do
ok = %w{ blah.gif blah.jpg blah.png BLAH.JPG
BLAH.Jpg abb/xyz/blah.gif}
bad = %w{ blah.doc blah.gif/more blah.gif.more
blah.gif.more }
ok.each do |name|
assert new_product(name).valid?,
"#{name} shouldn't be invalid'"
def create
omniauth = request.env["omniauth.auth"]
authentication = Authentication.find_by_provider_and_uid_and_token(omniauth['provider'], omniauth['uid'], omniauth['credentials']['token'] )
if authentication
flash[:notice] = "Signed in successfully."
sign_in_and_redirect(:user, authentication.user)
elsif current_user
current_user.authentications.create!(:provider => omniauth['provider'], :uid => omniauth['uid'], :token => omniauth['credentials']['token'])
flash[:notice] = "Authentication successful."
Twitter::Unauthorized in Pages#home
POST https://api.twitter.com/1/statuses/update.json: 401: Could not authenticate you.
FbGraph::InvalidRequest in User/authentications#index
OAuthException :: An active access token must be used to query information about the current user.
@JulioGMedina
JulioGMedina / gist:1177636
Created August 29, 2011 02:24
Shell Error
julio@ubuntu:~/rails/sandboxcart $ git push heroku master
Counting objects: 502, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (475/475), done.
Writing objects: 100% (502/502), 2.63 MiB | 458 KiB/s, done.
Total 502 (delta 44), reused 0 (delta 0)
-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Detected Rails is not set to serve static_assets
@JulioGMedina
JulioGMedina / gist:1177634
Created August 29, 2011 02:23
Shell Error
julio@ubuntu:~/rails/sandboxcart $ git push heroku master
Counting objects: 502, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (475/475), done.
Writing objects: 100% (502/502), 2.63 MiB | 458 KiB/s, done.
Total 502 (delta 44), reused 0 (delta 0)
-----> Heroku receiving push
-----> Ruby/Rails app detected
-----> Detected Rails is not set to serve static_assets