This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# == Schema Information | |
# | |
# Table name: product_data | |
# | |
# id :integer(4) not null, primary key | |
# filename :string(255) | |
# content_type :string(255) | |
# size :integer(4) | |
# created_at :datetime | |
# updated_at :datetime |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ProductDataController | |
#one method only used currently (rest to be deleted) | |
# POST /product_data | |
# POST /product_data.xml | |
def create | |
logger.info("POST /product_data") | |
@product_datum = ProductDatum.new(params[:product_datum]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This file is auto-generated from the current state of the database. Instead of editing this file, | |
# please use the migrations feature of Active Record to incrementally modify your database, and | |
# then regenerate this schema definition. | |
# | |
# Note that this schema.rb definition is the authoritative source for your database schema. If you need | |
# to create the application database on another system, you should be using db:schema:load, not running | |
# all the migrations from scratch. The latter is a flawed and unsustainable approach (the more migrations | |
# you'll amass, the slower it'll run and the greater likelihood for issues). | |
# | |
# It's strongly recommended to check this file into your version control system. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-config = extjs_form_for [@matter, @item],:fileUpload => true,:form_var =>form_id,:config_only=>true do |f| | |
= f.error_messages | |
=f.check_box :done, :fieldLabel =>"Completed" | |
=f.text_field :item, :fieldLabel => "Task" | |
=f.text_field :asignee_name, :fieldLabel =>"Assigned To" | |
=f.date_field :delivery_date, :fieldLabel =>"Due", :value =>f.object.delivery_date ? f.object.delivery_date.strftime("%m-%d-%Y"):"" | |
=f.check_box :critical, :fieldLabel =>"Critical" | |
=f.select :reminder, [["1 Day Before",1],["2 Days Before",2],["3 Days Before",3],["4 Days Before",4],["5 Days Before",5],["1 Week Before",7]],:fieldLabel =>"Reminder" | |
=f.numeric_field :estimate, :fieldLabel =>"Estimate" | |
=f.text_area :description |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'hashie' | |
require 'faraday' | |
require 'faraday_middleware' | |
gem "multi_json" | |
module Meterman | |
class Client | |
def initialize(adapter = Faraday.default_adapter, host = Meterman.host,port = Meterman.port, options={}) | |
@adapter,@host,@port, @http_options = adapter,host,port,options |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
context "server#addresses" do | |
context "and there is a private address key" do | |
it "returns the ip address" do | |
@server.should_receive(:addresses).any_number_of_times.and_return({"private"=>[{"version"=>4, "addr"=>"10.0.2.76"}]}) | |
@server.private_ip_address.should == "10.0.2.76" | |
end | |
end | |
context "and there is not a private address key" do | |
it "server#private_ip_address returns nil" do | |
#Stricly speaking this scenario cannot occur |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GET https://csnode.rndd.aw1.hpcloud.net:35357/v2.0/HP-IDM/v1.0/domains/61087284261695/services | |
X-Auth-Token: HPAuth_4f4505c4e4b08770c1a88452 | |
Accept: application/json | |
Content-Type: application/json | |
Accept-Encoding: gzip,deflate | |
--- | |
--- | |
200 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@connection2 ||= Fog::Compute.new( | |
:provider =>'HP', | |
:hp_account_id =>"#{@user.tenant_id}:#{access_key[:access_key_id]}", | |
:hp_secret_key => access_key[:secret_key], | |
:hp_auth_uri =>"http://az1-nv-schedule-0000.rndd.aw1.hpcloud.net:8774/v1.1/#{@user.tenant_id}", | |
:connection_options =>{ | |
:connect_timeout =>30, | |
:read_timeout =>30, | |
:write_timeout =>30 | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
puts :hi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Exploring the Internet of Things using Ruby | |
We live in a world that is increasingly connected. Everything from toasters to televisions has smart network aware devices in them. In the past such devices were accessed via proprietary protocols, but there has been a movement as of late to allow open easy access to these kind of embedded devices. | |
We will look at the current understanding of the Internet of Things, and some of the embedded devices, such as the Arduino and other technologies that are making it possible. | |
USB, wireless and serial communication to embedded devices will be examined, all with Ruby of course. A few practical hardware examples will be presented, such as a software build state monitor using Ruby and USB to talk to an LED lamp and an LED message board using wireless communication and Arduino. | |
We will also go over a few examples of Cloud based offerings, which allow you to mash up your devices in your home to the World Wide Web, for remote monitoring or collaboration. |
OlderNewer