Skip to content

Instantly share code, notes, and snippets.

class Object
def instance_variable_set(name, value)
super("@#{name}", value)
end
end
source "https://rubygems.org"
gem 'httmultiparty'
$:.unshift("/Library/RubyMotion/lib")
require 'motion/project'
Motion::Project::App.setup do |app|
app.name = 'wadus_app'
app.vendor_project 'vendor/tesseract', :static,
:headers_dir => 'include'
app.frameworks += ['CoreData']
end
class AuthController < ApplicationController
end
gem 'ruby-debug19'
= semantic_form_for @pet do |form|
= form.inputs do
= form.input :animal
= form.input :diseases, :as => :check_boxes
= form.buttons
class Animal < ActiveRecord::Base
has_many :diseases
has_many :pets
end
class Api::IdentificationsController < ApplicationController
#Provide an identification
def update
identification_attributes = {
:observationRowId => params[:rowid],
:scientificName => params[:scientificName],
:identificationTime => Time.now.strftime("%m-%d-%Y %H:%M:%S"),
:author => params[:username],
update named_areas as na SET area_protected = (
select
ST_Area(ST_Intersection(ST_Union(pa.the_geom), temp.the_geom))
from named_areas_protected_areas as napa, protected_areas as pa, (select id from named_areas where id=na.id) as temp
where napa.protected_area_id=pa.id AND named_area_id AND named_area_id = temp.id )
Partigirb::Client.new.items.index? :item_type => 'film' # => [#<Partigirb::PartigiStruct ptItem_title="The Shop Around the Corner", c...
Partigirb::Client.new.items.index.json? :item_type => 'film' # => Partigirb::PartigiError: #<Partigirb::PartigiError:0x257bc80>