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
| { | |
| "id": 11, | |
| "name": "belkyla", | |
| "loc": "vinkallare", | |
| "values": [ | |
| { | |
| "id": "11-91-0-slowRefresh", | |
| "nodeId": 11, | |
| "commandClass": 91, | |
| "commandClassName": "Central Scene", |
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
| //Structure of documents in collection: | |
| { | |
| _id: 1, | |
| name: "Some name", | |
| versions: [ | |
| { | |
| version: 1, | |
| data: {} | |
| }, |
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
| //The problem: this function is supposed to return a promise that is resolved when all chunks have been written | |
| //but the promise is resolved after the first chunk has been written (after line 28) | |
| //The intention is to resolve the promise on line 21 | |
| writeAt: function(fileName, chunks) { | |
| var def = $q.defer(); | |
| rootDir.getFile(fileName, {create: true}, function(fileEntry) { | |
| var totalBytesWritten = 0; | |
| var writeChunk = function(fileWriter, chunk) { | |
| console.log("Writing chunk at "+chunk.offset+" length "+chunk.data.byteLength); |
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
| instance_type = `curl -s http://169.254.169.254/latest/meta-data/instance-type` | |
| instance_type.gsub!(".","") | |
| env = node[:aws_hostname][:env] | |
| domain = "abc.com" | |
| execute "generate random hostname" do | |
| command "echo $(( $RANDOM % 1000 )) > /etc/randomhost" | |
| not_if { ::File.exists?("/etc/randomhost")} | |
| end | |
| random = `cat /etc/randomhost` | |
| hostname = "aws#{env}#{instance_type}#{random.strip}" |
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
| { | |
| "cursor": "BtreeCursor game_1_publishedAt_-1_setId_1_creatorLevel_1_categories_1", | |
| "isMultiKey": true, | |
| "n": 20, | |
| "nscannedObjects": 20020, | |
| "nscanned": 33224, | |
| "nscannedObjectsAllPlans": 60061, | |
| "nscannedAllPlans": 73267, | |
| "scanAndOrder": false, | |
| "indexOnly": false, |
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 Picture < ActiveRecord::Base | |
| has_many :imagables_pictures | |
| has_many :imagables, :through => :imagables_pictures | |
| end | |
| class ImagablesPicture < ActiveRecord::Base | |
| belongs_to :picture | |
| belongs_to :imageable, :polymorphic => true | |
| end | |