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 'faker' | |
| output = [] | |
| dates = [] | |
| 20.times do | |
| output << Faker::Commerce.product_name | |
| end | |
| 20.times do |
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
| var FluffyRouter = Backbone.Router.extend({ | |
| routes: { | |
| 'seal panda bunny': 'update', | |
| '*default': 'update' | |
| }, | |
| update: function(){ | |
| var id = Backbone.history.fragment || 'bunny'; | |
| $('.view').hide(); | |
| $('#' + id).show(); | |
| this.navigate(id); |
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.array!(@students) do |student| | |
| json.extract! student, :id, :name, :email, :phone, :location, :employment | |
| json.url student_url(student, format: :json) | |
| end |
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
| var StudentListView = Backbone.View.extend({ | |
| tagName: 'div', | |
| className: 'students-list', | |
| template: _.template($('#students-list-template').html()), | |
| initialize: function(){ | |
| this.listenTo(this.collection, 'sync', this.render); | |
| }, | |
| events: { | |
| 'submit form': 'onSubmit' | |
| }, |
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
| /* CSS declarations go here */ | |
| body { | |
| font-family: sans-serif; | |
| background-color: #315481; | |
| background-image: linear-gradient(to bottom, #315481, #918e82 100%); | |
| background-attachment: fixed; | |
| position: absolute; | |
| top: 0; | |
| bottom: 0; |
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
| def self.available_bikes(distance, id) | |
| doc = Nokogiri::XML(open("http://www.capitalbikeshare.com/data/stations/bikeStations.xml")) | |
| # spits out the number of bikes at a given station | |
| doc.xpath('//station').each do |node| | |
| if node.children[0].text == "#{id}" | |
| latitude = node.children[4].text | |
| distance = distance.round(2) | |
| longitude = node.children[5].text | |
| bikes = node.children[12].text | |
| docks = node.children[13].text |
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
| var Evaluation = React.createClass({ | |
| getInitialState: function() { | |
| return {evaluation: this.props.evaluation}; | |
| }, | |
| updateData: function(form, data) { | |
| var index = this.state.evaluation.indexOf(form); | |
| var form_data = React.addons.update(this.state.evaluation[index].form, | |
| { $merge: data }); | |
| form.form = form_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
| - sentence_beginning: | |
| - 'lazy' | |
| - 'dog' | |
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
| - text_section: 'The lazy dog' | |
| part_of_speech: 'verb' | |
| - text_section: 'over the brown fox. This little' | |
| part_of_speech: 'type of animal' |
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
| validationPlaceholder() { | |
| if (this.state.validation_error && this.state.validation_data.status === 'required') { | |
| return 'REQUIRED'; | |
| } | |
| }, | |
| toggleInput() { | |
| if (this.props.edit) { | |
| return ( | |
| <div> |
OlderNewer