This file contains hidden or 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
# Hello | |
[I'm an inline-style link](https://www.google.com) |
This file contains hidden or 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
# User CenteredSoftware Experience Modeling |
This file contains hidden or 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
<!-- Screencast on how to add a service function --> | |
<div ng-controller="SayMyService">{{ say() }}</div> | |
.factory('myService', function () { | |
return { | |
say: function () { | |
return "Hello World"; | |
} |
This file contains hidden or 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
API is implemented at : | |
http://ariise.com/api/matrix/min_weigth.json- | |
- mandatory parameter: matrix. | |
Matrix is sent to server as string, like: "[[3,1,4],[1,5,9],[2,6,5]]", | |
"[[3,1,4],[1,5,9],[2,6,5,4,7]]", etc. | |
Return: | |
- status: 200: valid call, 205: invalid matrix |
This file contains hidden or 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
= simple_form_for([:admin, resource], | |
:url => resource.new_record? ? collection_url : resource_url(resource), | |
:html => {:multipart => true, :method => (resource.new_record? ? "post" : "put") } ) do |f| | |
- if resource.errors.any? | |
%tr | |
%td{:colspan => "2"} | |
%h2 | |
= pluralize(resource.errors.count, "error") | |
prohibited this testa from being saved: | |
%ul |
This file contains hidden or 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
class Content_Package::Unpack | |
include ActiveModel::Serializers::JSON | |
include ActiveModel::Validations | |
ATTRIBUTES = [:test_id, :question_id, :answer] | |
attr_accessor *ATTRIBUTES | |
validates_presence_of :test_id, :question_id | |
validates_inclusion_of :answer, :in => %w[A B C D] | |
This file contains hidden or 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 'rubygems' | |
require 'json' | |
json_str = '[ | |
{"title":"GRE Connect","subject":"GRE","type":["bookmark"]}, | |
{"title":"GRE Connect","desc":"another book","type":["bookmark","bookmark_type","reading"]} | |
]' | |
arr = JSON.parse(json_str) | |
p arr |
This file contains hidden or 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
#JSON object wrapper providing a native Ruby datatype | |
class UserResultSet | |
attr_reader :uri, :devices :email | |
def initialize(attributes) | |
@uri = attributes[:uri] | |
@devices = attributes[:email] | |
@email = attributes[:first_name] | |
end |
NewerOlder