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
http.get path, (response) -> | |
s = '' | |
response.on 'data', (chunk) -> | |
s += chunk | |
response.on 'end', -> | |
console.log s |
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
module.exports = (grunt) -> | |
site_path = 'asdasd' | |
request = require 'request' | |
urls = ['/main', '/about', '/contacts', '/payment'] | |
request "#{site_path}/api/items", (error, response, body) -> | |
for item in JSON.parse body | |
urls.push "/api/items/#{item.key}" | |
console.log urls |
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
var data = { | |
constituents: $q.when(ConstituentsRepository.getData()), | |
hierarhy: hierarchyService.getModel() | |
} | |
$q.all(data).then(function(response){ | |
alert('done'); | |
}); |
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
.service 'dataRepository', ($q, Categories, Items, Settings, Session) -> | |
data: {} | |
fetch: -> | |
res = $q.defer() | |
foo = | |
categories: Categories.fetch() | |
items: Items.fetch() | |
settings: Settings.fetch() | |
user: Session.fetch() |
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
.service 'dataRepository', ($q, Categories, Items, Settings, Session) -> | |
data: {} | |
fetch: -> | |
res = $q.defer() | |
foo = | |
categories: Categories.fetch() | |
items: Items.fetch() | |
settings: Settings.fetch() | |
user: Session.fetch() |
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
.service 'dataRepository', ($q, Categories, Items, Settings, Session) -> | |
data: {} | |
fetch: -> | |
res = $q.defer() | |
foo = | |
categories: Categories.fetch() | |
items: Items.fetch() | |
settings: Settings.fetch() | |
user: Session.fetch() |
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
def index | |
if params[:_escaped_fragment_] | |
render "public/snapshots/about.html", layout: false | |
else | |
render 'index' | |
end | |
end |
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
var names = this.element.all(by.binding('requirement.name')).getText(); | |
var inputs = this.element.all(by.model('requirement.value')); | |
protractor.promise.all([names, inputs]).then(function(data){ | |
var requirements = []; | |
_.forEach(data[1], function(input, k){ | |
requirements.push(new TextValue(data[1][k])); // succeed | |
requirements.push(new TextValue(input)); //Error:(25, 37) TS2345: Argument of type '{}' is not assignable to parameter of type 'ElementFinder'. | |
}); | |
}); |
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
var names = this.element.all(by.binding('requirement.name')).getText(); | |
var inputs = this.element.all(by.model('requirement.value')); | |
protractor.promise.all([names, inputs]).then(function(data){ | |
var requirements = []; | |
_.forEach(data[1], function(input:protractor.ElementFinder, k){ | |
var req ={ | |
name: names[k], | |
input: new TextValue(input) | |
}; | |
requirements.push(req); |
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
$http.get('/api/feedbacks').then (feedbacks) => | |
_.each feedbacks.data, (feedback) => | |
if feedback.feedbacks | |
feedbacks = [] | |
_.each feedback.feedbacks, (feedback) => | |
feedbacks.push new Feedback feedback | |
feedback.feedbacks = feedbacks | |
@feedbacks.push new Feedback feedback | |
@feedback |
OlderNewer