Skip to content

Instantly share code, notes, and snippets.

View thomasv314's full-sized avatar

Thomas Vendetta thomasv314

View GitHub Profile
@thomasv314
thomasv314 / layout.html.erb
Created June 23, 2011 14:56
Description of a Rails 3 View file
<!DOCTYPE html>
<html>
<head>
<title><%= title %></title>
<%= stylesheet_link_tag :all %>
<link href="http://fonts.googleapis.com/css?family=Cantarell:regular,italic,bold,bolditalic" rel="stylesheet" type="text/css" >
<link href='http://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<%= javascript_include_tag :defaults %>
<%= csrf_meta_tag %>
</head>
<% if [email protected]? %>
<% @mentions.each do |mention| %>
$('#mentions').append('<%= escape_javascript("<div class=\"mention\"> #{mention[:text]} <br/><em>by #{link_to mention[:user][:name], "http://twitter.com/" + mention[:user][:screen_name]} </em></div>
") %>');
<% end %>
<% end %>
@thomasv314
thomasv314 / gist:1058944
Created July 1, 2011 17:00
NoMethodError: Undefined method 'deg2rad' for #<Class:0x0000>
class Listing < ActiveRecord::Base
set_table_name :Listing
scope :near, lambda{
|*args|
origin = *args.first[:origin]
if (origin).is_a?(Array)
origin_lat, origin_lng = origin
else
origin_lat, origin_lng = origin.latitude, origin.longitude
@thomasv314
thomasv314 / Controller.rb
Created July 14, 2011 15:19
Layar#new_pois is making a request for listings in near a certain lat/long/radius. It pulls all those listings and iterates through to grab data about each. GeoKit gem is returning the sam lat/long/distance for each. Ideas?
class LayarController < ApplicationController
include LayarHelper
def new_pois
userId = params[:userId]
developerId = params[:developerId]
developerHash = params[:developerHash]
timestamp = params[:timestamp]
layerName = params[:layerName]
@thomasv314
thomasv314 / gist:1179180
Created August 29, 2011 19:31
Rails error message when trying to generate a fresh devise install on a fresh rails 3.1 application
DevMac:AJJReg thomasvendetta$ rails generate devise:install
/Users/thomasvendetta/.rvm/gems/ruby-1.9.2-p290@rails31pre/gems/actionpack-3.1.0.rc6/lib/sprockets/railtie.rb:21:in `block (2 levels) in <class:Railtie>': undefined method `static_root=' for #<Sprockets::Environment:0x00000102e9e5a0> (NoMethodError)
from /Users/thomasvendetta/.rvm/gems/ruby-1.9.2-p290@rails31pre/gems/sprockets-2.0.0/lib/sprockets/environment.rb:55:in `initialize'
from /Users/thomasvendetta/.rvm/gems/ruby-1.9.2-p290@rails31pre/gems/actionpack-3.1.0.rc6/lib/sprockets/railtie.rb:20:in `new'
from /Users/thomasvendetta/.rvm/gems/ruby-1.9.2-p290@rails31pre/gems/actionpack-3.1.0.rc6/lib/sprockets/railtie.rb:20:in `block in <class:Railtie>'
from /Users/thomasvendetta/.rvm/gems/ruby-1.9.2-p290@rails31pre/gems/railties-3.1.0.rc6/lib/rails/initializable.rb:25:in `instance_exec'
from /Users/thomasvendetta/.rvm/gems/ruby-1.9.2-p290@rails31pre/gems/railties-3.1.0.rc6/lib/rails/initializable.rb:25:in `run'
from /Users/thomasvendetta/.rvm/gems
{
"kind": "Listing",
"data": {
"modhash": "",
"children": [
{
"kind": "t3",
"data": {
"domain": "i.imgur.com",
"media_embed": {},
Event Load (0.5ms) SELECT "events".* FROM "events" WHERE "events"."slug" = 'suna2011' LIMIT 1
NetForumRegistration Load (0.2ms) SELECT "net_forum_registrations".* FROM "net_forum_registrations" WHERE "net_forum_registrations"."id" = ? LIMIT 1 [["id", 1]]
Event Load (0.4ms) SELECT "events".* FROM "events" WHERE "events"."id" = 1 LIMIT 1
NetForumHandler Load (7.8ms) SELECT "net_forum_handlers".* FROM "net_forum_handlers" WHERE "net_forum_handlers"."id" = 1 LIMIT 1
reg = {
"szObjectName" => "RegistrationDemographics",
"oNode" =>
{
"RegistrationDemographicsObjects" =>
{
"RegistrationDemographicsObject" =>
{
"rdm_key" => nil,
"rdm_add_user" => nil,
@thomasv314
thomasv314 / response.bash
Created November 1, 2011 16:15
Savon Client Request
NoMethodError: You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.[]
from /Users/thomasvendetta/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/savon-0.9.7/lib/savon/soap/fault.rb:33:in `to_hash'
from /Users/thomasvendetta/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/savon-0.9.7/lib/savon/soap/fault.rb:28:in `to_s'
from /Users/thomasvendetta/Code/RegApp/app/models/registrant.rb:277:in `rescue in nf_shopping_cart_insert'
from /Users/thomasvendetta/Code/RegApp/app/models/registrant.rb:273:in `nf_shopping_cart_insert'
from (irb):14
from /Users/thomasvendetta/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/commands/console.rb:45:in `start'
from /Users/thomasvendetta/.rbenv/versions/1.9.2-p290/lib/ruby/gems/1.9.1/gems/railties-3.1.0/lib/rails/commands/console.rb:8:in `start'
@thomasv314
thomasv314 / gist:1331698
Created November 1, 2011 19:47
DanceLessonsHamden.com
Spidered Text :
Arthur Murray Hamden, New Haven-Dance Lessons for Beginners, Ballroom Dancing, Wedding Dance Programs- Arthur Murray Hamden International Studio News Hamden Studio News Arthur Murray Hamden - Subscribe to our RSS Posts Comments E-mail Home Directions History New Student Offer Our Studio Programs 6 Slide 4 Slide 3-Weddings Slide 2- Arthur Murray inc. Slide 1 New Student Offer Private Dance Lesson Offers for BeginnersArthur Murray® Hamden, CT dancing instructors are specially trained and certified in social, salsa, ballroom dancing and many more styles. Our dance instructors can put you in touch with today’s most popular dances to make you comfortable in social dance scenes or if you are interested in becoming a competitive dancer. Whether you’re dancing at your wedding or in a dancing at a local ballroom dance competition, the Hamden dance instructors will have you dancing on your feet in no time!Click here to learn more Connecticut Dance Scene ARTHUR MURRAY INTERNATIONAL BIDS FAREWELL TO