Skip to content

Instantly share code, notes, and snippets.

.zone_selection
= grouped_collection_select(:event, :zone_id, @locations, :zones, :name, :id, :name, {:selected => "50463aa79438a08e45000037"})
= params
# Generates the following HTML
<div class='zone_selection'>
<select id="event_zone_id" name="event[zone_id]"><optgroup label="Roman&#x27;s Home"><option value="50463aa79438a08e45000001">Garden Side</option>
<option value="50463aa79438a08e4500000a">Doorbell</option>
<option value="50463aa79438a08e45000037">Entrance (Front)</option>
Xanview2::Application.configure do
# Settings specified here will take precedence over those in config/application.rb
# Code is not reloaded between requests
config.cache_classes = true
# Full error reports are disabled and caching is turned on
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
require File.expand_path('../boot', __FILE__)
require "action_controller/railtie"
require "action_mailer/railtie"
require "active_resource/railtie"
require "rails/test_unit/railtie"
if defined?(Bundler)
# If you precompile assets before deploying to production, use this line
!!!
%html
%head
%title Xanview: Monitoring Solutions
/[if lt IE 9]
= javascript_include_tag "http://html5shim.googlecode.com/svn/trunk/html5.js"
= stylesheet_link_tag "application", :media => "all"
= javascript_include_tag "application"
= csrf_meta_tags
%meta{:content => "width=device-width, initial-scale=1.0", :name => "viewport"}
def parse_command(command_id, data)
command = find_command(command_id)
parsed = {name: command[:name]}.with_indifferent_access
return parsed unless command[:bytes] # Return if no parsable data
# Detect Expected Size
expected_length = 0
command[:bytes].each do |byte_range, value_id|
value = data[byte_range]
class PerspectivesController < ApplicationController
# GET /perspectives
# GET /perspectives.json
def index
@perspectives = Perspective.all
unless params['perspective']
@perspective = @perspectives.where(default: true).first || Perspective.new
else
@perspective = Perspective.new
end
raw_params = {"layout"=>"layout_04", "zone_ids"=>["", "", "", "50e5a81a421aa977fa00000b"]}
params = ActionController::Parameters.new(raw_params)
params.permit(:zone_ids)
>>> {}
From server:
```
$ live555ProxyServer -V rtsp://192.168.0.221/live2.sdp
LIVE555 Proxy Server
(LIVE555 Streaming Media library version 2013.03.23)
Opening connection to 192.168.0.221, port 554...
RTSP stream, proxying the stream "rtsp://192.168.0.221/live2.sdp"
Play this stream using the URL: rtsp://192.168.0.2:8554/proxyStream
# In my controller:
def create
p request.body.read
render :json => "ok"
end
# Output from the above:
"cameras[_id][%24oid]=51d77340367ff8eaae000013&cameras[active]=true&cameras[audio_device]=auto&cameras[created_at]=2013-07-06T02%3A30%3A40.910%2B01%3A00&cameras[detect_url]=rtsp%3A%2F%2Fadmin%3A123456%40192.168.88.15%3A7070%2Ftrack1&cameras[force_tcp]=false&cameras[record_url]=&cameras[server_id][%24oid]=51d77197367ff8593d000005&cameras[transcode]=false&cameras[transcode_quality]=30.0&cameras[updated_at]=2013-07-07T18%3A03%3A56.636%2B01%3A00&cameras[zone_id][%24oid]=51d77320367ff853bb000005&cameras[server][serial]=c638a12b0681da034715&cameras[_id][%24oid]=51d99de3367ff847d3000002&cameras[active]=true&cameras[audio_device]=auto&cameras[created_at]=2013-07-07T17%3A57%3A07.131%2B01%3A00&cameras[detect_url]=rtsp%3A%2F%2F123.123.123.123%2F&cameras[force_tcp]=false&cameras[record_url]=&cameras[server_id][%24oid]=51d77197367ff8593d000005&cameras[transcode]=false&cameras[transcode_quality]=30.0&cameras[
# # Commands
# echo 'deb-src http://ppa.launchpad.net/nginx/stable/ubuntu utopic main' > /etc/apt/sources.list
# apt-get update
# apt-get build-dep nginx
# apt-get source nginx
# cd nginx-1.6.2
# dpkg-buildpackage